{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "from sklearn import datasets\n",
    "import matplotlib.pyplot as plt\n",
    "import numpy as np\n",
    "import pandas as pd"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [],
   "source": [
    "digits = datasets.load_digits()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(1797, 8, 8)"
      ]
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "digits.images.shape"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [],
   "source": [
    "def plotFigure(features):\n",
    "    plt.figure(1, figsize=(3, 3))\n",
    "    plt.imshow(features, cmap=plt.cm.gray_r, interpolation='nearest')\n",
    "    plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "0\n"
     ]
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAMIAAADFCAYAAAAG5C2JAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMi4yLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvhp/UCwAACXJJREFUeJzt3V2IXPUdxvHv01VpfQnGGoq40jUgASlUYxBEEKpN0SraiyoJKFQK3lRRWjDau97pjdiLIkjUCqaK8QVErFZQaYXWuhvTVo0WjSlu1Sahii+FBvXXi51AjBtzlp6Xmfj9wOLO7PDPw8YnZ+ac+c0/VYX0ZfeVoQNI48AiSFgECbAIEmARJMAiSIBFkACLIAEWQQLgsC4WPf7442tmZqaLpVvz7rvvtrre/Px8q+sBLFu2rNX1pqenW10PYGpqqvU127Rjxw52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ziLNBivLEtYBAmwCBJgESQAUlXtL5rsApq8DeN4YHfrAdo17hnHPR8Mm/GbVXXQK7ydFKGpJLNVNdYfJTnuGcc9H0xGRp8aSVgECRi+CLcP/Oc3Me4Zxz0fTEDGQV8jSONi6COCNBYsgsRARUhyfpJXk7yW5HM7dA4tyUlJnk6yLclLSa4dOtOBJJkabfv76NBZFpPk2CQPJHll9Ps8a+hMi+n9NcLoAwD+zsLbuueB54H1VTU2GxQmOQE4oaq2JDkGmAN+ME4Z90ryUxa29VpWVRcNnWd/Se4G/lBVG0dTjkdW1XtD59rfEEeEM4HXqmp7Ve0B7gMuGSDHAVXV21W1ZfT9B8A24MRhU31ekmngQmDj0FkWk2QZcA5wB0BV7RnHEsAwRTgReHOf2/OM4f9keyWZAU4HnvviRw7iVuB64NOhgxzASmAXcNfo6dvGJEcNHWoxQxQhi9w3ludwkxwNPAhcV1XvD51nX0kuAnZW1Tjv/nEYC5vT31ZVpwMfAWP3mhCGKcI8cNI+t6eBtwbI8YWSHM5CCTZV1TiOqJ4NXJxkBwtPL89Ncs+wkT5nHpivqr1H0wdYKMbYGaIIzwOnJDl59OJpHfDIADkOKElYeF67rapuGTrPYqrqxqqarqoZFn6HT1XV5QPH+oyqegd4M8mq0V3nAWN3wgEG2EOtqj5OcjXwBDAF3FlVL/Wd4yDOBq4A/pZk6+i+n1fVYwNmmlTXAJtG/+htB64cOM+ifIuFhFeWJcAiSIBFkACLIAEWQQIsggRYBAmA/wHK5bFx4f2LswAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<Figure size 216x216 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "0\n",
      "-----------------\n",
      "1\n"
     ]
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAMIAAADFCAYAAAAG5C2JAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29md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AAAElFTkSuQmCC\n",
      "text/plain": [
       "<Figure size 216x216 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "1\n",
      "-----------------\n",
      "2\n"
     ]
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAMIAAADFCAYAAAAG5C2JAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMi4yLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvhp/UCwAACW9JREFUeJzt3d2LXeUZhvHrblTqd6BKERM6ChKQgokEQQRBbYtWMTnogYJCQsGTKoYWRHuk/4DEgyJI/AKt0sZPxGoFDa3QWpM4tsZoSUKKU7VJKMFooUF9ejA7EOMkWUPXx97j9YPB2TOb19vgnbX3WuvZb6oK6ZvuW0MHkMaBRZCwCBJgESTAIkiARZAAiyABFkECLIIEwAldLHrWWWfV1NRUF0uPrQMHDrS+5s6dO1td7+STT251PYBly5a1vmabdu/ezb59+3K853VShKmpKTZv3tzF0mNr06ZNra+5evXqVtdbvnx5q+tBN//dbVq5cmWj5/nSSMIiSIBFkACLIAEWQQIaFiHJ1UneT7IjyZ1dh5L6dtwiJFkE/Aq4BrgQuDHJhV0Hk/rU5IhwCbCjqnZV1UHgSWBVt7GkfjUpwrnAB4c9nhn97CuS3JJkc5LNe/fubSuf1IsmRZjr8vTXJv6r6oGqWllVK88+++z/P5nUoyZFmAGWHvZ4CfBhN3GkYTQpwpvABUnOS3IScAPwfLexpH4d96a7qvo8ya3Ay8Ai4KGq2tZ5MqlHje4+raoXgRc7ziINxivLEhZBAiyCBHQ0oTYJpqenW13viiuuaHU9gDPPPLPV9Xbv3t3qeguJRwQJiyABFkECLIIEWAQJsAgSYBEkoNmo5kNJ9iR5p49A0hCaHBEeAa7uOIc0qOMWoar+APy7hyzSYFp7j+DM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gT1VtGTrLMZzA7Ob091fVCuAzYOzeE8IwRZgBlh72eAnw4QA5jinJicyW4PGqGscR1cuA65PsZvbl5ZVJHhs20tfMADNVdehoupHZYoydIYrwJnBBkvNGb55uAJ4fIMdRJQmzr2u3V9W9Q+eZS1XdVVVLqmqK2T/DV6vqpoFjfUVVfQx8kGTZ6EdXAWN3wgEG2EOtqj5PcivwMrAIeKiqtvWd4zguA24G/pbk0OZov6yqFwfMNKluAx4f/aW3C1g7cJ45eYuFhFeWJcAiSIBFkACLIAEWQQIsggRYBAmA/wFz8qnEnbSuBAAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<Figure size 216x216 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "2\n",
      "-----------------\n",
      "3\n"
     ]
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAMIAAADFCAYAAAAG5C2JAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMi4yLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvhp/UCwAACaFJREFUeJzt3VuIXfUZhvHn7WhoPaFUKZJIx4AIUqiHQRBBqNqiVbQXRRQsVArJRRWlBYm96525EXtRJBK1glaxHkDEaiNRWqG1TmLaqtFiY4qjpkkw4qHQoH69mB2IZuKswXXYOz4/GDJ7z+LLx5A3a+211rf+qSqkL7uvDN2ANA4MgoRBkACDIAEGQQIMggQYBAkwCBJgECQADuui6PHHH1/T09NdlG7Njh07Wq335ptvtloPYNmyZa3WO+2001qtBzA1NdV6zTZt376d3bt3Z7HtOgnC9PQ0s7OzXZRuzdq1a1utt2bNmlbrASxfvrzVehs3bmy1HsBxxx3Xes02zczMNNrOQyMJgyABBkECDIIEGAQJaBiEJBcleTXJa0naPz0iDWzRICSZAn4NXAycBlyVpP0T0tKAmuw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yMJgyABwwfh9oH//ibGvcdx7w8moMdBPyNI42LoPYI0FgyCxEBBSHJRkleTvJbkgBU6h5bkpCRPJ9ma5KUk1w/d08EkmRot+/vY0L0sJMmxSR5M8sro93nO0D0tpPfPCKMHAPyT+du654DngauqamwWKExyInBiVW1OcjSwCfjBOPW4T5KfMb+s1zFVdenQ/XxWkruBP1XV+tGU4xFV9e7QfX3WEHuEs4HXqmpbVe0F7gcuH6CPg6qqt6tq8+j794GtwPJhuzpQkhXAJcD6oXtZSJJjgPOAOwCqau84hgCGCcJy4I39Xs8xhv/I9kkyDZwBPPf5Ww7iVuBG4JOhGzmIlcAu4K7R4dv6JEcO3dRChghCFnhvLM/hJjkKeAi4oareG7qf/SW5FNhZVZuG7uVzHMb84vS3VdUZwIfA2H0mhGGCMAectN/rFcBbA/TxuZIcznwI7q2qcRxRPRe4LMl25g8vz09yz7AtHWAOmKuqfXvTB5kPxtgZIgjPA6ckOXn04elK4NEB+jioJGH+uHZrVd0ydD8LqaqbqmpFVU0z/zvcWFVXD9zWp1TVDuCNJKeO3roAGLsTDjDAGmpV9VGSa4EngSngzqp6qe8+FnEu8CPgH0m2jN77RVU9PmBPk+o64N7Rf3rbgGsG7mdB3mIh4ZVlCTAIEmAQJMAgSIBBkACDIAEGQQLg/0fDtfXrpkrZAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<Figure size 216x216 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "3\n",
      "-----------------\n",
      "4\n"
     ]
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAMIAAADFCAYAAAAG5C2JAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMi4yLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvhp/UCwAACVdJREFUeJzt3d2LHfU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IkiARZAAiyABFkECLIIENHt01BlJNu/39WGS1X2Ek/rS5Ik5bwErAJIsAf7J3AMFpUVjoYdGFwJ/r6p/dBFGGspCi3Al8OB8v3B4X5OscRFG02mXAb+e7/cO72uSLWSPcDGwqar+1VUYaSgLKcJVHOSwSJp0TT/79Gjge8Cj3caRhtF0eP8/wNc7ziINxivLEhZBAiyCBFgECYBUVfuLJjuBJrdhLAV2tR6gXeOecdzzwbAZv1lVh73C20kRmkqyoarG+qMkxz3juOeDycjooZGERZCA4Ytwz8D//ibGPeO454MJyDjoewRpXAy9R5DGgkWQGKgISS5K8laSt5N84QmdQ0tycpIXkmxJ8nqSm4bOdDBJlowe+/vU0Fnmk2QqycNJ3hz9eZ4zdKb59P4eYfQBAH9j7rbuWeAV4KqqGpsHFCY5ETixqjYlOQ7YCFwxThn3SfIT5h7rdXxVXTp0ngMlWQf8vqrWjKYcj66q3UPnOtAQe4RVwNtVtbWq9gAPAZcPkOOgquq9qto0+v4jYAtw0rCpvijJcuASYM3QWeaT5HjgPOBegKraM44lgGGKcBKwfb/Xs4zh/2T7JJkGzgJePvSWg7gTuAX4bOggB3EqsBNYOzp8W5PkmKFDzWeIImSen43lOdwkxwKPAKur6sOh8+wvyaXAjqraOHSWQziCuYfT311VZwGfAGP3nhCGKcIscPJ+r5cD7w6Q45CSHMlcCdZX1TiOqJ4LXJZkG3OHlxckeWDYSF8wC8xW1b696cPMFWPsDFGEV4DTk5wyevN0JfDkADkOKkmYO67dUlV3DJ1nPlV1W1Utr6pp5v4Mn6+qqweO9TlV9T6wPckZox9dCIzdCQcY4BlqVfVpkhuAZ4ElwH1V9XrfOQ7jXOAa4K9JNo9+9rOqenrATJPqRmD96C+9rcB1A+eZl7dYSHhlWQIsggRYBAmwCBJgESTAIkiARZAA+B9VpabE6OId8AAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<Figure size 216x216 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "4\n",
      "-----------------\n"
     ]
    }
   ],
   "source": [
    "for i in range(0, 5):\n",
    "    features = digits.images[i]\n",
    "    label = digits.target[i]\n",
    "    \n",
    "    print(i)\n",
    "    plotFigure(features)\n",
    "    print(label)\n",
    "    print(\"-----------------\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[ 0.,  0.,  5., 13.,  9.,  1.,  0.,  0.],\n",
       "       [ 0.,  0., 13., 15., 10., 15.,  5.,  0.],\n",
       "       [ 0.,  3., 15.,  2.,  0., 11.,  8.,  0.],\n",
       "       [ 0.,  4., 12.,  0.,  0.,  8.,  8.,  0.],\n",
       "       [ 0.,  5.,  8.,  0.,  0.,  9.,  8.,  0.],\n",
       "       [ 0.,  4., 11.,  0.,  1., 12.,  7.,  0.],\n",
       "       [ 0.,  2., 14.,  5., 10., 12.,  0.,  0.],\n",
       "       [ 0.,  0.,  6., 13., 10.,  0.,  0.,  0.]])"
      ]
     },
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "digits.images[0]"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Min Max Normalization"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [],
   "source": [
    "min_limit = digits.images.min()\n",
    "max_limit = digits.images.max()\n",
    "\n",
    "digits.images = (digits.images - min_limit) / (max_limit - min_limit)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[0.    , 0.    , 0.3125, 0.8125, 0.5625, 0.0625, 0.    , 0.    ],\n",
       "       [0.    , 0.    , 0.8125, 0.9375, 0.625 , 0.9375, 0.3125, 0.    ],\n",
       "       [0.    , 0.1875, 0.9375, 0.125 , 0.    , 0.6875, 0.5   , 0.    ],\n",
       "       [0.    , 0.25  , 0.75  , 0.    , 0.    , 0.5   , 0.5   , 0.    ],\n",
       "       [0.    , 0.3125, 0.5   , 0.    , 0.    , 0.5625, 0.5   , 0.    ],\n",
       "       [0.    , 0.25  , 0.6875, 0.    , 0.0625, 0.75  , 0.4375, 0.    ],\n",
       "       [0.    , 0.125 , 0.875 , 0.3125, 0.625 , 0.75  , 0.    , 0.    ],\n",
       "       [0.    , 0.    , 0.375 , 0.8125, 0.625 , 0.    , 0.    , 0.    ]])"
      ]
     },
     "execution_count": 8,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "digits.images[0]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "0.0  to  1.0\n"
     ]
    }
   ],
   "source": [
    "print(digits.images.min(), \" to \", digits.images.max())"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Train test split"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [],
   "source": [
    "from sklearn.model_selection import train_test_split"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {},
   "outputs": [],
   "source": [
    "#70%: train, 15%: val, 15% test"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {},
   "outputs": [],
   "source": [
    "train_x, val_x, train_y, val_y = train_test_split(digits.images, digits.target, test_size=0.30, random_state=17)\n",
    "val_x, test_x, val_y, test_y = train_test_split(val_x, val_y, test_size=0.50, random_state=17)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "trainset size:  1257\n",
      "validationset size:  270\n",
      "testset size:  270\n"
     ]
    }
   ],
   "source": [
    "print(\"trainset size: \",train_x.shape[0])\n",
    "print(\"validationset size: \",val_x.shape[0])\n",
    "print(\"testset size: \",test_x.shape[0])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {},
   "outputs": [],
   "source": [
    "train_x = train_x.reshape(train_x.shape[0], 64)\n",
    "val_x = val_x.reshape(val_x.shape[0], 64)\n",
    "test_x = test_x.reshape(test_x.shape[0], 64)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Model"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "Using TensorFlow backend.\n"
     ]
    }
   ],
   "source": [
    "import keras\n",
    "from keras.models import Model\n",
    "from keras.layers import Dense, Activation\n",
    "from keras.datasets import mnist\n",
    "from keras.optimizers import Adam\n",
    "from keras.models import Sequential\n",
    "from keras import backend as K\n",
    "from keras.callbacks import ModelCheckpoint,EarlyStopping"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {},
   "outputs": [],
   "source": [
    "model = Sequential()\n",
    "model.add(Dense(32, activation='relu', input_shape=(64,)))\n",
    "model.add(Dense(16, activation='relu'))\n",
    "model.add(Dense(8, activation='relu'))\n",
    "model.add(Dense(4, activation='relu'))\n",
    "model.add(Dense(2, activation='relu'))\n",
    "model.add(Dense(4, activation='relu'))\n",
    "model.add(Dense(8, activation='relu'))\n",
    "model.add(Dense(16, activation='relu'))\n",
    "model.add(Dense(32, activation='relu'))\n",
    "model.add(Dense(64, activation='sigmoid'))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "metadata": {},
   "outputs": [],
   "source": [
    "model.compile(loss='binary_crossentropy', optimizer=keras.optimizers.Adam())\n",
    "\n",
    "checkpointer = ModelCheckpoint(\n",
    "    filepath='autoencode_digit.hdf5'\n",
    "    , monitor = \"val_loss\"\n",
    "    , verbose=1\n",
    "    , save_best_only=True\n",
    "    , mode = 'auto'\n",
    ")\n",
    "\n",
    "earlyStop = EarlyStopping(monitor='val_loss', patience=50)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Train on 1257 samples, validate on 270 samples\n",
      "Epoch 1/5000\n",
      "1257/1257 [==============================] - 1s 603us/step - loss: 0.6637 - val_loss: 0.5730\n",
      "\n",
      "Epoch 00001: val_loss improved from inf to 0.57296, saving model to autoencode_digit.hdf5\n",
      "Epoch 2/5000\n",
      "1257/1257 [==============================] - 0s 49us/step - loss: 0.4874 - val_loss: 0.4366\n",
      "\n",
      "Epoch 00002: val_loss improved from 0.57296 to 0.43658, saving model to autoencode_digit.hdf5\n",
      "Epoch 3/5000\n",
      "1257/1257 [==============================] - 0s 56us/step - loss: 0.4278 - val_loss: 0.4205\n",
      "\n",
      "Epoch 00003: val_loss improved from 0.43658 to 0.42048, saving model to autoencode_digit.hdf5\n",
      "Epoch 4/5000\n",
      "1257/1257 [==============================] - 0s 51us/step - loss: 0.4185 - val_loss: 0.4132\n",
      "\n",
      "Epoch 00004: val_loss improved from 0.42048 to 0.41320, saving model to autoencode_digit.hdf5\n",
      "Epoch 5/5000\n",
      "1257/1257 [==============================] - 0s 49us/step - loss: 0.4104 - val_loss: 0.4045\n",
      "\n",
      "Epoch 00005: val_loss improved from 0.41320 to 0.40448, saving model to autoencode_digit.hdf5\n",
      "Epoch 6/5000\n",
      "1257/1257 [==============================] - 0s 49us/step - loss: 0.4023 - val_loss: 0.3989\n",
      "\n",
      "Epoch 00006: val_loss improved from 0.40448 to 0.39888, saving model to autoencode_digit.hdf5\n",
      "Epoch 7/5000\n",
      "1257/1257 [==============================] - 0s 48us/step - loss: 0.3978 - val_loss: 0.3962\n",
      "\n",
      "Epoch 00007: val_loss improved from 0.39888 to 0.39619, saving model to autoencode_digit.hdf5\n",
      "Epoch 8/5000\n",
      "1257/1257 [==============================] - 0s 53us/step - loss: 0.3958 - val_loss: 0.3951\n",
      "\n",
      "Epoch 00008: val_loss improved from 0.39619 to 0.39508, saving model to autoencode_digit.hdf5\n",
      "Epoch 9/5000\n",
      "1257/1257 [==============================] - 0s 51us/step - loss: 0.3945 - val_loss: 0.3941\n",
      "\n",
      "Epoch 00009: val_loss improved from 0.39508 to 0.39408, saving model to autoencode_digit.hdf5\n",
      "Epoch 10/5000\n",
      "1257/1257 [==============================] - 0s 47us/step - loss: 0.3933 - val_loss: 0.3940\n",
      "\n",
      "Epoch 00010: val_loss improved from 0.39408 to 0.39398, saving model to autoencode_digit.hdf5\n",
      "Epoch 11/5000\n",
      "1257/1257 [==============================] - 0s 51us/step - loss: 0.3925 - val_loss: 0.3932\n",
      "\n",
      "Epoch 00011: val_loss improved from 0.39398 to 0.39325, saving model to autoencode_digit.hdf5\n",
      "Epoch 12/5000\n",
      "1257/1257 [==============================] - 0s 53us/step - loss: 0.3913 - val_loss: 0.3926\n",
      "\n",
      "Epoch 00012: val_loss improved from 0.39325 to 0.39264, saving model to autoencode_digit.hdf5\n",
      "Epoch 13/5000\n",
      "1257/1257 [==============================] - 0s 45us/step - loss: 0.3906 - val_loss: 0.3917\n",
      "\n",
      "Epoch 00013: val_loss improved from 0.39264 to 0.39173, saving model to autoencode_digit.hdf5\n",
      "Epoch 14/5000\n",
      "1257/1257 [==============================] - 0s 48us/step - loss: 0.3896 - val_loss: 0.3908\n",
      "\n",
      "Epoch 00014: val_loss improved from 0.39173 to 0.39079, saving model to autoencode_digit.hdf5\n",
      "Epoch 15/5000\n",
      "1257/1257 [==============================] - 0s 53us/step - loss: 0.3890 - val_loss: 0.3900\n",
      "\n",
      "Epoch 00015: val_loss improved from 0.39079 to 0.38998, saving model to autoencode_digit.hdf5\n",
      "Epoch 16/5000\n",
      "1257/1257 [==============================] - 0s 42us/step - loss: 0.3875 - val_loss: 0.3893\n",
      "\n",
      "Epoch 00016: val_loss improved from 0.38998 to 0.38925, saving model to autoencode_digit.hdf5\n",
      "Epoch 17/5000\n",
      "1257/1257 [==============================] - 0s 54us/step - loss: 0.3863 - val_loss: 0.3879\n",
      "\n",
      "Epoch 00017: val_loss improved from 0.38925 to 0.38787, saving model to autoencode_digit.hdf5\n",
      "Epoch 18/5000\n",
      "1257/1257 [==============================] - 0s 48us/step - loss: 0.3851 - val_loss: 0.3868\n",
      "\n",
      "Epoch 00018: val_loss improved from 0.38787 to 0.38676, saving model to autoencode_digit.hdf5\n",
      "Epoch 19/5000\n",
      "1257/1257 [==============================] - 0s 55us/step - loss: 0.3838 - val_loss: 0.3865\n",
      "\n",
      "Epoch 00019: val_loss improved from 0.38676 to 0.38652, saving model to autoencode_digit.hdf5\n",
      "Epoch 20/5000\n",
      "1257/1257 [==============================] - 0s 49us/step - loss: 0.3828 - val_loss: 0.3848\n",
      "\n",
      "Epoch 00020: val_loss improved from 0.38652 to 0.38480, saving model to autoencode_digit.hdf5\n",
      "Epoch 21/5000\n",
      "1257/1257 [==============================] - 0s 68us/step - loss: 0.3813 - val_loss: 0.3840\n",
      "\n",
      "Epoch 00021: val_loss improved from 0.38480 to 0.38401, saving model to autoencode_digit.hdf5\n",
      "Epoch 22/5000\n",
      "1257/1257 [==============================] - 0s 61us/step - loss: 0.3801 - val_loss: 0.3825\n",
      "\n",
      "Epoch 00022: val_loss improved from 0.38401 to 0.38246, saving model to autoencode_digit.hdf5\n",
      "Epoch 23/5000\n",
      "1257/1257 [==============================] - 0s 64us/step - loss: 0.3788 - val_loss: 0.3806\n",
      "\n",
      "Epoch 00023: val_loss improved from 0.38246 to 0.38056, saving model to autoencode_digit.hdf5\n",
      "Epoch 24/5000\n",
      "1257/1257 [==============================] - 0s 69us/step - loss: 0.3774 - val_loss: 0.3792\n",
      "\n",
      "Epoch 00024: val_loss improved from 0.38056 to 0.37918, saving model to autoencode_digit.hdf5\n",
      "Epoch 25/5000\n",
      "1257/1257 [==============================] - 0s 53us/step - loss: 0.3754 - val_loss: 0.3791\n",
      "\n",
      "Epoch 00025: val_loss improved from 0.37918 to 0.37912, saving model to autoencode_digit.hdf5\n",
      "Epoch 26/5000\n",
      "1257/1257 [==============================] - 0s 57us/step - loss: 0.3740 - val_loss: 0.3757\n",
      "\n",
      "Epoch 00026: val_loss improved from 0.37912 to 0.37570, saving model to autoencode_digit.hdf5\n",
      "Epoch 27/5000\n",
      "1257/1257 [==============================] - 0s 55us/step - loss: 0.3725 - val_loss: 0.3758\n",
      "\n",
      "Epoch 00027: val_loss did not improve from 0.37570\n",
      "Epoch 28/5000\n",
      "1257/1257 [==============================] - 0s 61us/step - loss: 0.3714 - val_loss: 0.3744\n",
      "\n",
      "Epoch 00028: val_loss improved from 0.37570 to 0.37442, saving model to autoencode_digit.hdf5\n",
      "Epoch 29/5000\n",
      "1257/1257 [==============================] - 0s 57us/step - loss: 0.3702 - val_loss: 0.3721\n",
      "\n",
      "Epoch 00029: val_loss improved from 0.37442 to 0.37208, saving model to autoencode_digit.hdf5\n",
      "Epoch 30/5000\n",
      "1257/1257 [==============================] - 0s 61us/step - loss: 0.3686 - val_loss: 0.3714\n",
      "\n",
      "Epoch 00030: val_loss improved from 0.37208 to 0.37139, saving model to autoencode_digit.hdf5\n",
      "Epoch 31/5000\n",
      "1257/1257 [==============================] - 0s 60us/step - loss: 0.3680 - val_loss: 0.3695\n",
      "\n",
      "Epoch 00031: val_loss improved from 0.37139 to 0.36953, saving model to autoencode_digit.hdf5\n",
      "Epoch 32/5000\n",
      "1257/1257 [==============================] - 0s 62us/step - loss: 0.3670 - val_loss: 0.3694\n",
      "\n",
      "Epoch 00032: val_loss improved from 0.36953 to 0.36937, saving model to autoencode_digit.hdf5\n",
      "Epoch 33/5000\n",
      "1257/1257 [==============================] - 0s 58us/step - loss: 0.3655 - val_loss: 0.3696\n",
      "\n",
      "Epoch 00033: val_loss did not improve from 0.36937\n",
      "Epoch 34/5000\n",
      "1257/1257 [==============================] - 0s 56us/step - loss: 0.3647 - val_loss: 0.3676\n",
      "\n",
      "Epoch 00034: val_loss improved from 0.36937 to 0.36759, saving model to autoencode_digit.hdf5\n",
      "Epoch 35/5000\n",
      "1257/1257 [==============================] - 0s 54us/step - loss: 0.3637 - val_loss: 0.3667\n",
      "\n",
      "Epoch 00035: val_loss improved from 0.36759 to 0.36671, saving model to autoencode_digit.hdf5\n",
      "Epoch 36/5000\n",
      "1257/1257 [==============================] - 0s 55us/step - loss: 0.3625 - val_loss: 0.3656\n",
      "\n",
      "Epoch 00036: val_loss improved from 0.36671 to 0.36564, saving model to autoencode_digit.hdf5\n",
      "Epoch 37/5000\n",
      "1257/1257 [==============================] - 0s 50us/step - loss: 0.3620 - val_loss: 0.3660\n",
      "\n",
      "Epoch 00037: val_loss did not improve from 0.36564\n",
      "Epoch 38/5000\n",
      "1257/1257 [==============================] - 0s 49us/step - loss: 0.3607 - val_loss: 0.3636\n",
      "\n",
      "Epoch 00038: val_loss improved from 0.36564 to 0.36360, saving model to autoencode_digit.hdf5\n",
      "Epoch 39/5000\n",
      "1257/1257 [==============================] - 0s 45us/step - loss: 0.3598 - val_loss: 0.3637\n",
      "\n",
      "Epoch 00039: val_loss did not improve from 0.36360\n",
      "Epoch 40/5000\n",
      "1257/1257 [==============================] - 0s 53us/step - loss: 0.3592 - val_loss: 0.3632\n",
      "\n",
      "Epoch 00040: val_loss improved from 0.36360 to 0.36321, saving model to autoencode_digit.hdf5\n",
      "Epoch 41/5000\n",
      "1257/1257 [==============================] - 0s 53us/step - loss: 0.3584 - val_loss: 0.3631\n",
      "\n",
      "Epoch 00041: val_loss improved from 0.36321 to 0.36312, saving model to autoencode_digit.hdf5\n",
      "Epoch 42/5000\n",
      "1257/1257 [==============================] - 0s 53us/step - loss: 0.3577 - val_loss: 0.3617\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "\n",
      "Epoch 00042: val_loss improved from 0.36312 to 0.36168, saving model to autoencode_digit.hdf5\n",
      "Epoch 43/5000\n",
      "1257/1257 [==============================] - 0s 48us/step - loss: 0.3566 - val_loss: 0.3610\n",
      "\n",
      "Epoch 00043: val_loss improved from 0.36168 to 0.36096, saving model to autoencode_digit.hdf5\n",
      "Epoch 44/5000\n",
      "1257/1257 [==============================] - 0s 43us/step - loss: 0.3559 - val_loss: 0.3608\n",
      "\n",
      "Epoch 00044: val_loss improved from 0.36096 to 0.36078, saving model to autoencode_digit.hdf5\n",
      "Epoch 45/5000\n",
      "1257/1257 [==============================] - 0s 44us/step - loss: 0.3556 - val_loss: 0.3599\n",
      "\n",
      "Epoch 00045: val_loss improved from 0.36078 to 0.35990, saving model to autoencode_digit.hdf5\n",
      "Epoch 46/5000\n",
      "1257/1257 [==============================] - 0s 52us/step - loss: 0.3548 - val_loss: 0.3600\n",
      "\n",
      "Epoch 00046: val_loss did not improve from 0.35990\n",
      "Epoch 47/5000\n",
      "1257/1257 [==============================] - 0s 45us/step - loss: 0.3546 - val_loss: 0.3593\n",
      "\n",
      "Epoch 00047: val_loss improved from 0.35990 to 0.35925, saving model to autoencode_digit.hdf5\n",
      "Epoch 48/5000\n",
      "1257/1257 [==============================] - 0s 50us/step - loss: 0.3537 - val_loss: 0.3583\n",
      "\n",
      "Epoch 00048: val_loss improved from 0.35925 to 0.35826, saving model to autoencode_digit.hdf5\n",
      "Epoch 49/5000\n",
      "1257/1257 [==============================] - 0s 52us/step - loss: 0.3532 - val_loss: 0.3585\n",
      "\n",
      "Epoch 00049: val_loss did not improve from 0.35826\n",
      "Epoch 50/5000\n",
      "1257/1257 [==============================] - 0s 52us/step - loss: 0.3530 - val_loss: 0.3576\n",
      "\n",
      "Epoch 00050: val_loss improved from 0.35826 to 0.35756, saving model to autoencode_digit.hdf5\n",
      "Epoch 51/5000\n",
      "1257/1257 [==============================] - 0s 61us/step - loss: 0.3524 - val_loss: 0.3572\n",
      "\n",
      "Epoch 00051: val_loss improved from 0.35756 to 0.35720, saving model to autoencode_digit.hdf5\n",
      "Epoch 52/5000\n",
      "1257/1257 [==============================] - 0s 48us/step - loss: 0.3520 - val_loss: 0.3572\n",
      "\n",
      "Epoch 00052: val_loss improved from 0.35720 to 0.35719, saving model to autoencode_digit.hdf5\n",
      "Epoch 53/5000\n",
      "1257/1257 [==============================] - 0s 56us/step - loss: 0.3518 - val_loss: 0.3565\n",
      "\n",
      "Epoch 00053: val_loss improved from 0.35719 to 0.35646, saving model to autoencode_digit.hdf5\n",
      "Epoch 54/5000\n",
      "1257/1257 [==============================] - 0s 49us/step - loss: 0.3513 - val_loss: 0.3566\n",
      "\n",
      "Epoch 00054: val_loss did not improve from 0.35646\n",
      "Epoch 55/5000\n",
      "1257/1257 [==============================] - 0s 49us/step - loss: 0.3509 - val_loss: 0.3551\n",
      "\n",
      "Epoch 00055: val_loss improved from 0.35646 to 0.35510, saving model to autoencode_digit.hdf5\n",
      "Epoch 56/5000\n",
      "1257/1257 [==============================] - 0s 50us/step - loss: 0.3504 - val_loss: 0.3555\n",
      "\n",
      "Epoch 00056: val_loss did not improve from 0.35510\n",
      "Epoch 57/5000\n",
      "1257/1257 [==============================] - 0s 43us/step - loss: 0.3501 - val_loss: 0.3552\n",
      "\n",
      "Epoch 00057: val_loss did not improve from 0.35510\n",
      "Epoch 58/5000\n",
      "1257/1257 [==============================] - 0s 43us/step - loss: 0.3495 - val_loss: 0.3546\n",
      "\n",
      "Epoch 00058: val_loss improved from 0.35510 to 0.35464, saving model to autoencode_digit.hdf5\n",
      "Epoch 59/5000\n",
      "1257/1257 [==============================] - 0s 51us/step - loss: 0.3494 - val_loss: 0.3542\n",
      "\n",
      "Epoch 00059: val_loss improved from 0.35464 to 0.35423, saving model to autoencode_digit.hdf5\n",
      "Epoch 60/5000\n",
      "1257/1257 [==============================] - 0s 65us/step - loss: 0.3487 - val_loss: 0.3541\n",
      "\n",
      "Epoch 00060: val_loss improved from 0.35423 to 0.35405, saving model to autoencode_digit.hdf5\n",
      "Epoch 61/5000\n",
      "1257/1257 [==============================] - 0s 57us/step - loss: 0.3485 - val_loss: 0.3537\n",
      "\n",
      "Epoch 00061: val_loss improved from 0.35405 to 0.35369, saving model to autoencode_digit.hdf5\n",
      "Epoch 62/5000\n",
      "1257/1257 [==============================] - 0s 49us/step - loss: 0.3482 - val_loss: 0.3543\n",
      "\n",
      "Epoch 00062: val_loss did not improve from 0.35369\n",
      "Epoch 63/5000\n",
      "1257/1257 [==============================] - 0s 49us/step - loss: 0.3481 - val_loss: 0.3528\n",
      "\n",
      "Epoch 00063: val_loss improved from 0.35369 to 0.35281, saving model to autoencode_digit.hdf5\n",
      "Epoch 64/5000\n",
      "1257/1257 [==============================] - 0s 48us/step - loss: 0.3476 - val_loss: 0.3525\n",
      "\n",
      "Epoch 00064: val_loss improved from 0.35281 to 0.35250, saving model to autoencode_digit.hdf5\n",
      "Epoch 65/5000\n",
      "1257/1257 [==============================] - 0s 48us/step - loss: 0.3474 - val_loss: 0.3524\n",
      "\n",
      "Epoch 00065: val_loss improved from 0.35250 to 0.35240, saving model to autoencode_digit.hdf5\n",
      "Epoch 66/5000\n",
      "1257/1257 [==============================] - 0s 53us/step - loss: 0.3471 - val_loss: 0.3524\n",
      "\n",
      "Epoch 00066: val_loss improved from 0.35240 to 0.35239, saving model to autoencode_digit.hdf5\n",
      "Epoch 67/5000\n",
      "1257/1257 [==============================] - 0s 50us/step - loss: 0.3471 - val_loss: 0.3525\n",
      "\n",
      "Epoch 00067: val_loss did not improve from 0.35239\n",
      "Epoch 68/5000\n",
      "1257/1257 [==============================] - 0s 50us/step - loss: 0.3466 - val_loss: 0.3522\n",
      "\n",
      "Epoch 00068: val_loss improved from 0.35239 to 0.35222, saving model to autoencode_digit.hdf5\n",
      "Epoch 69/5000\n",
      "1257/1257 [==============================] - 0s 44us/step - loss: 0.3464 - val_loss: 0.3518\n",
      "\n",
      "Epoch 00069: val_loss improved from 0.35222 to 0.35181, saving model to autoencode_digit.hdf5\n",
      "Epoch 70/5000\n",
      "1257/1257 [==============================] - 0s 48us/step - loss: 0.3464 - val_loss: 0.3509\n",
      "\n",
      "Epoch 00070: val_loss improved from 0.35181 to 0.35088, saving model to autoencode_digit.hdf5\n",
      "Epoch 71/5000\n",
      "1257/1257 [==============================] - 0s 51us/step - loss: 0.3455 - val_loss: 0.3506\n",
      "\n",
      "Epoch 00071: val_loss improved from 0.35088 to 0.35058, saving model to autoencode_digit.hdf5\n",
      "Epoch 72/5000\n",
      "1257/1257 [==============================] - 0s 56us/step - loss: 0.3451 - val_loss: 0.3503\n",
      "\n",
      "Epoch 00072: val_loss improved from 0.35058 to 0.35029, saving model to autoencode_digit.hdf5\n",
      "Epoch 73/5000\n",
      "1257/1257 [==============================] - 0s 50us/step - loss: 0.3452 - val_loss: 0.3501\n",
      "\n",
      "Epoch 00073: val_loss improved from 0.35029 to 0.35011, saving model to autoencode_digit.hdf5\n",
      "Epoch 74/5000\n",
      "1257/1257 [==============================] - 0s 51us/step - loss: 0.3445 - val_loss: 0.3503\n",
      "\n",
      "Epoch 00074: val_loss did not improve from 0.35011\n",
      "Epoch 75/5000\n",
      "1257/1257 [==============================] - 0s 57us/step - loss: 0.3442 - val_loss: 0.3494\n",
      "\n",
      "Epoch 00075: val_loss improved from 0.35011 to 0.34938, saving model to autoencode_digit.hdf5\n",
      "Epoch 76/5000\n",
      "1257/1257 [==============================] - 0s 50us/step - loss: 0.3440 - val_loss: 0.3499\n",
      "\n",
      "Epoch 00076: val_loss did not improve from 0.34938\n",
      "Epoch 77/5000\n",
      "1257/1257 [==============================] - 0s 50us/step - loss: 0.3439 - val_loss: 0.3486\n",
      "\n",
      "Epoch 00077: val_loss improved from 0.34938 to 0.34860, saving model to autoencode_digit.hdf5\n",
      "Epoch 78/5000\n",
      "1257/1257 [==============================] - 0s 48us/step - loss: 0.3433 - val_loss: 0.3484\n",
      "\n",
      "Epoch 00078: val_loss improved from 0.34860 to 0.34844, saving model to autoencode_digit.hdf5\n",
      "Epoch 79/5000\n",
      "1257/1257 [==============================] - 0s 53us/step - loss: 0.3430 - val_loss: 0.3494\n",
      "\n",
      "Epoch 00079: val_loss did not improve from 0.34844\n",
      "Epoch 80/5000\n",
      "1257/1257 [==============================] - 0s 53us/step - loss: 0.3433 - val_loss: 0.3485\n",
      "\n",
      "Epoch 00080: val_loss did not improve from 0.34844\n",
      "Epoch 81/5000\n",
      "1257/1257 [==============================] - 0s 60us/step - loss: 0.3428 - val_loss: 0.3478\n",
      "\n",
      "Epoch 00081: val_loss improved from 0.34844 to 0.34776, saving model to autoencode_digit.hdf5\n",
      "Epoch 82/5000\n",
      "1257/1257 [==============================] - 0s 50us/step - loss: 0.3423 - val_loss: 0.3486\n",
      "\n",
      "Epoch 00082: val_loss did not improve from 0.34776\n",
      "Epoch 83/5000\n",
      "1257/1257 [==============================] - 0s 57us/step - loss: 0.3426 - val_loss: 0.3474\n",
      "\n",
      "Epoch 00083: val_loss improved from 0.34776 to 0.34743, saving model to autoencode_digit.hdf5\n",
      "Epoch 84/5000\n",
      "1257/1257 [==============================] - 0s 53us/step - loss: 0.3419 - val_loss: 0.3473\n",
      "\n",
      "Epoch 00084: val_loss improved from 0.34743 to 0.34728, saving model to autoencode_digit.hdf5\n",
      "Epoch 85/5000\n",
      "1257/1257 [==============================] - 0s 44us/step - loss: 0.3421 - val_loss: 0.3477\n",
      "\n",
      "Epoch 00085: val_loss did not improve from 0.34728\n",
      "Epoch 86/5000\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "1257/1257 [==============================] - 0s 50us/step - loss: 0.3416 - val_loss: 0.3471\n",
      "\n",
      "Epoch 00086: val_loss improved from 0.34728 to 0.34706, saving model to autoencode_digit.hdf5\n",
      "Epoch 87/5000\n",
      "1257/1257 [==============================] - 0s 54us/step - loss: 0.3416 - val_loss: 0.3467\n",
      "\n",
      "Epoch 00087: val_loss improved from 0.34706 to 0.34669, saving model to autoencode_digit.hdf5\n",
      "Epoch 88/5000\n",
      "1257/1257 [==============================] - 0s 50us/step - loss: 0.3412 - val_loss: 0.3471\n",
      "\n",
      "Epoch 00088: val_loss did not improve from 0.34669\n",
      "Epoch 89/5000\n",
      "1257/1257 [==============================] - 0s 51us/step - loss: 0.3412 - val_loss: 0.3470\n",
      "\n",
      "Epoch 00089: val_loss did not improve from 0.34669\n",
      "Epoch 90/5000\n",
      "1257/1257 [==============================] - 0s 48us/step - loss: 0.3411 - val_loss: 0.3461\n",
      "\n",
      "Epoch 00090: val_loss improved from 0.34669 to 0.34606, saving model to autoencode_digit.hdf5\n",
      "Epoch 91/5000\n",
      "1257/1257 [==============================] - 0s 45us/step - loss: 0.3407 - val_loss: 0.3467\n",
      "\n",
      "Epoch 00091: val_loss did not improve from 0.34606\n",
      "Epoch 92/5000\n",
      "1257/1257 [==============================] - 0s 56us/step - loss: 0.3406 - val_loss: 0.3455\n",
      "\n",
      "Epoch 00092: val_loss improved from 0.34606 to 0.34546, saving model to autoencode_digit.hdf5\n",
      "Epoch 93/5000\n",
      "1257/1257 [==============================] - 0s 53us/step - loss: 0.3408 - val_loss: 0.3459\n",
      "\n",
      "Epoch 00093: val_loss did not improve from 0.34546\n",
      "Epoch 94/5000\n",
      "1257/1257 [==============================] - 0s 55us/step - loss: 0.3406 - val_loss: 0.3468\n",
      "\n",
      "Epoch 00094: val_loss did not improve from 0.34546\n",
      "Epoch 95/5000\n",
      "1257/1257 [==============================] - 0s 45us/step - loss: 0.3407 - val_loss: 0.3460\n",
      "\n",
      "Epoch 00095: val_loss did not improve from 0.34546\n",
      "Epoch 96/5000\n",
      "1257/1257 [==============================] - 0s 50us/step - loss: 0.3404 - val_loss: 0.3463\n",
      "\n",
      "Epoch 00096: val_loss did not improve from 0.34546\n",
      "Epoch 97/5000\n",
      "1257/1257 [==============================] - 0s 49us/step - loss: 0.3399 - val_loss: 0.3449\n",
      "\n",
      "Epoch 00097: val_loss improved from 0.34546 to 0.34489, saving model to autoencode_digit.hdf5\n",
      "Epoch 98/5000\n",
      "1257/1257 [==============================] - 0s 59us/step - loss: 0.3399 - val_loss: 0.3455\n",
      "\n",
      "Epoch 00098: val_loss did not improve from 0.34489\n",
      "Epoch 99/5000\n",
      "1257/1257 [==============================] - 0s 54us/step - loss: 0.3398 - val_loss: 0.3452\n",
      "\n",
      "Epoch 00099: val_loss did not improve from 0.34489\n",
      "Epoch 100/5000\n",
      "1257/1257 [==============================] - 0s 54us/step - loss: 0.3395 - val_loss: 0.3445\n",
      "\n",
      "Epoch 00100: val_loss improved from 0.34489 to 0.34451, saving model to autoencode_digit.hdf5\n",
      "Epoch 101/5000\n",
      "1257/1257 [==============================] - 0s 48us/step - loss: 0.3394 - val_loss: 0.3450\n",
      "\n",
      "Epoch 00101: val_loss did not improve from 0.34451\n",
      "Epoch 102/5000\n",
      "1257/1257 [==============================] - 0s 49us/step - loss: 0.3395 - val_loss: 0.3444\n",
      "\n",
      "Epoch 00102: val_loss improved from 0.34451 to 0.34443, saving model to autoencode_digit.hdf5\n",
      "Epoch 103/5000\n",
      "1257/1257 [==============================] - 0s 55us/step - loss: 0.3396 - val_loss: 0.3454\n",
      "\n",
      "Epoch 00103: val_loss did not improve from 0.34443\n",
      "Epoch 104/5000\n",
      "1257/1257 [==============================] - 0s 57us/step - loss: 0.3396 - val_loss: 0.3445\n",
      "\n",
      "Epoch 00104: val_loss did not improve from 0.34443\n",
      "Epoch 105/5000\n",
      "1257/1257 [==============================] - 0s 52us/step - loss: 0.3392 - val_loss: 0.3450\n",
      "\n",
      "Epoch 00105: val_loss did not improve from 0.34443\n",
      "Epoch 106/5000\n",
      "1257/1257 [==============================] - 0s 45us/step - loss: 0.3392 - val_loss: 0.3448\n",
      "\n",
      "Epoch 00106: val_loss did not improve from 0.34443\n",
      "Epoch 107/5000\n",
      "1257/1257 [==============================] - 0s 45us/step - loss: 0.3392 - val_loss: 0.3444\n",
      "\n",
      "Epoch 00107: val_loss improved from 0.34443 to 0.34442, saving model to autoencode_digit.hdf5\n",
      "Epoch 108/5000\n",
      "1257/1257 [==============================] - 0s 44us/step - loss: 0.3388 - val_loss: 0.3441\n",
      "\n",
      "Epoch 00108: val_loss improved from 0.34442 to 0.34412, saving model to autoencode_digit.hdf5\n",
      "Epoch 109/5000\n",
      "1257/1257 [==============================] - 0s 53us/step - loss: 0.3386 - val_loss: 0.3439\n",
      "\n",
      "Epoch 00109: val_loss improved from 0.34412 to 0.34390, saving model to autoencode_digit.hdf5\n",
      "Epoch 110/5000\n",
      "1257/1257 [==============================] - 0s 49us/step - loss: 0.3386 - val_loss: 0.3445\n",
      "\n",
      "Epoch 00110: val_loss did not improve from 0.34390\n",
      "Epoch 111/5000\n",
      "1257/1257 [==============================] - 0s 45us/step - loss: 0.3391 - val_loss: 0.3441\n",
      "\n",
      "Epoch 00111: val_loss did not improve from 0.34390\n",
      "Epoch 112/5000\n",
      "1257/1257 [==============================] - 0s 49us/step - loss: 0.3385 - val_loss: 0.3443\n",
      "\n",
      "Epoch 00112: val_loss did not improve from 0.34390\n",
      "Epoch 113/5000\n",
      "1257/1257 [==============================] - 0s 50us/step - loss: 0.3384 - val_loss: 0.3435\n",
      "\n",
      "Epoch 00113: val_loss improved from 0.34390 to 0.34347, saving model to autoencode_digit.hdf5\n",
      "Epoch 114/5000\n",
      "1257/1257 [==============================] - 0s 54us/step - loss: 0.3385 - val_loss: 0.3440\n",
      "\n",
      "Epoch 00114: val_loss did not improve from 0.34347\n",
      "Epoch 115/5000\n",
      "1257/1257 [==============================] - 0s 56us/step - loss: 0.3382 - val_loss: 0.3431\n",
      "\n",
      "Epoch 00115: val_loss improved from 0.34347 to 0.34311, saving model to autoencode_digit.hdf5\n",
      "Epoch 116/5000\n",
      "1257/1257 [==============================] - 0s 46us/step - loss: 0.3383 - val_loss: 0.3435\n",
      "\n",
      "Epoch 00116: val_loss did not improve from 0.34311\n",
      "Epoch 117/5000\n",
      "1257/1257 [==============================] - 0s 49us/step - loss: 0.3381 - val_loss: 0.3434\n",
      "\n",
      "Epoch 00117: val_loss did not improve from 0.34311\n",
      "Epoch 118/5000\n",
      "1257/1257 [==============================] - 0s 50us/step - loss: 0.3380 - val_loss: 0.3436\n",
      "\n",
      "Epoch 00118: val_loss did not improve from 0.34311\n",
      "Epoch 119/5000\n",
      "1257/1257 [==============================] - 0s 45us/step - loss: 0.3382 - val_loss: 0.3441\n",
      "\n",
      "Epoch 00119: val_loss did not improve from 0.34311\n",
      "Epoch 120/5000\n",
      "1257/1257 [==============================] - 0s 45us/step - loss: 0.3384 - val_loss: 0.3425\n",
      "\n",
      "Epoch 00120: val_loss improved from 0.34311 to 0.34255, saving model to autoencode_digit.hdf5\n",
      "Epoch 121/5000\n",
      "1257/1257 [==============================] - 0s 45us/step - loss: 0.3380 - val_loss: 0.3428\n",
      "\n",
      "Epoch 00121: val_loss did not improve from 0.34255\n",
      "Epoch 122/5000\n",
      "1257/1257 [==============================] - 0s 51us/step - loss: 0.3378 - val_loss: 0.3428\n",
      "\n",
      "Epoch 00122: val_loss did not improve from 0.34255\n",
      "Epoch 123/5000\n",
      "1257/1257 [==============================] - 0s 54us/step - loss: 0.3376 - val_loss: 0.3431\n",
      "\n",
      "Epoch 00123: val_loss did not improve from 0.34255\n",
      "Epoch 124/5000\n",
      "1257/1257 [==============================] - 0s 48us/step - loss: 0.3377 - val_loss: 0.3426\n",
      "\n",
      "Epoch 00124: val_loss did not improve from 0.34255\n",
      "Epoch 125/5000\n",
      "1257/1257 [==============================] - 0s 50us/step - loss: 0.3376 - val_loss: 0.3426\n",
      "\n",
      "Epoch 00125: val_loss did not improve from 0.34255\n",
      "Epoch 126/5000\n",
      "1257/1257 [==============================] - 0s 51us/step - loss: 0.3376 - val_loss: 0.3429\n",
      "\n",
      "Epoch 00126: val_loss did not improve from 0.34255\n",
      "Epoch 127/5000\n",
      "1257/1257 [==============================] - 0s 50us/step - loss: 0.3373 - val_loss: 0.3426\n",
      "\n",
      "Epoch 00127: val_loss did not improve from 0.34255\n",
      "Epoch 128/5000\n",
      "1257/1257 [==============================] - 0s 44us/step - loss: 0.3374 - val_loss: 0.3426\n",
      "\n",
      "Epoch 00128: val_loss did not improve from 0.34255\n",
      "Epoch 129/5000\n",
      "1257/1257 [==============================] - 0s 45us/step - loss: 0.3373 - val_loss: 0.3426\n",
      "\n",
      "Epoch 00129: val_loss did not improve from 0.34255\n",
      "Epoch 130/5000\n",
      "1257/1257 [==============================] - 0s 50us/step - loss: 0.3369 - val_loss: 0.3423\n",
      "\n",
      "Epoch 00130: val_loss improved from 0.34255 to 0.34232, saving model to autoencode_digit.hdf5\n",
      "Epoch 131/5000\n",
      "1257/1257 [==============================] - 0s 53us/step - loss: 0.3367 - val_loss: 0.3420\n",
      "\n",
      "Epoch 00131: val_loss improved from 0.34232 to 0.34198, saving model to autoencode_digit.hdf5\n",
      "Epoch 132/5000\n",
      "1257/1257 [==============================] - 0s 50us/step - loss: 0.3365 - val_loss: 0.3414\n",
      "\n",
      "Epoch 00132: val_loss improved from 0.34198 to 0.34138, saving model to autoencode_digit.hdf5\n",
      "Epoch 133/5000\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "1257/1257 [==============================] - 0s 52us/step - loss: 0.3367 - val_loss: 0.3421\n",
      "\n",
      "Epoch 00133: val_loss did not improve from 0.34138\n",
      "Epoch 134/5000\n",
      "1257/1257 [==============================] - 0s 55us/step - loss: 0.3361 - val_loss: 0.3414\n",
      "\n",
      "Epoch 00134: val_loss did not improve from 0.34138\n",
      "Epoch 135/5000\n",
      "1257/1257 [==============================] - 0s 55us/step - loss: 0.3362 - val_loss: 0.3409\n",
      "\n",
      "Epoch 00135: val_loss improved from 0.34138 to 0.34093, saving model to autoencode_digit.hdf5\n",
      "Epoch 136/5000\n",
      "1257/1257 [==============================] - 0s 45us/step - loss: 0.3362 - val_loss: 0.3411\n",
      "\n",
      "Epoch 00136: val_loss did not improve from 0.34093\n",
      "Epoch 137/5000\n",
      "1257/1257 [==============================] - 0s 44us/step - loss: 0.3359 - val_loss: 0.3415\n",
      "\n",
      "Epoch 00137: val_loss did not improve from 0.34093\n",
      "Epoch 138/5000\n",
      "1257/1257 [==============================] - 0s 45us/step - loss: 0.3358 - val_loss: 0.3408\n",
      "\n",
      "Epoch 00138: val_loss improved from 0.34093 to 0.34083, saving model to autoencode_digit.hdf5\n",
      "Epoch 139/5000\n",
      "1257/1257 [==============================] - 0s 45us/step - loss: 0.3358 - val_loss: 0.3405\n",
      "\n",
      "Epoch 00139: val_loss improved from 0.34083 to 0.34048, saving model to autoencode_digit.hdf5\n",
      "Epoch 140/5000\n",
      "1257/1257 [==============================] - 0s 45us/step - loss: 0.3357 - val_loss: 0.3405\n",
      "\n",
      "Epoch 00140: val_loss did not improve from 0.34048\n",
      "Epoch 141/5000\n",
      "1257/1257 [==============================] - 0s 49us/step - loss: 0.3354 - val_loss: 0.3406\n",
      "\n",
      "Epoch 00141: val_loss did not improve from 0.34048\n",
      "Epoch 142/5000\n",
      "1257/1257 [==============================] - 0s 60us/step - loss: 0.3351 - val_loss: 0.3397\n",
      "\n",
      "Epoch 00142: val_loss improved from 0.34048 to 0.33973, saving model to autoencode_digit.hdf5\n",
      "Epoch 143/5000\n",
      "1257/1257 [==============================] - 0s 51us/step - loss: 0.3350 - val_loss: 0.3401\n",
      "\n",
      "Epoch 00143: val_loss did not improve from 0.33973\n",
      "Epoch 144/5000\n",
      "1257/1257 [==============================] - 0s 44us/step - loss: 0.3354 - val_loss: 0.3402\n",
      "\n",
      "Epoch 00144: val_loss did not improve from 0.33973\n",
      "Epoch 145/5000\n",
      "1257/1257 [==============================] - 0s 49us/step - loss: 0.3349 - val_loss: 0.3398\n",
      "\n",
      "Epoch 00145: val_loss did not improve from 0.33973\n",
      "Epoch 146/5000\n",
      "1257/1257 [==============================] - 0s 50us/step - loss: 0.3345 - val_loss: 0.3400\n",
      "\n",
      "Epoch 00146: val_loss did not improve from 0.33973\n",
      "Epoch 147/5000\n",
      "1257/1257 [==============================] - 0s 45us/step - loss: 0.3345 - val_loss: 0.3398\n",
      "\n",
      "Epoch 00147: val_loss did not improve from 0.33973\n",
      "Epoch 148/5000\n",
      "1257/1257 [==============================] - 0s 44us/step - loss: 0.3345 - val_loss: 0.3388\n",
      "\n",
      "Epoch 00148: val_loss improved from 0.33973 to 0.33877, saving model to autoencode_digit.hdf5\n",
      "Epoch 149/5000\n",
      "1257/1257 [==============================] - 0s 50us/step - loss: 0.3346 - val_loss: 0.3397\n",
      "\n",
      "Epoch 00149: val_loss did not improve from 0.33877\n",
      "Epoch 150/5000\n",
      "1257/1257 [==============================] - 0s 49us/step - loss: 0.3342 - val_loss: 0.3397\n",
      "\n",
      "Epoch 00150: val_loss did not improve from 0.33877\n",
      "Epoch 151/5000\n",
      "1257/1257 [==============================] - 0s 45us/step - loss: 0.3343 - val_loss: 0.3391\n",
      "\n",
      "Epoch 00151: val_loss did not improve from 0.33877\n",
      "Epoch 152/5000\n",
      "1257/1257 [==============================] - 0s 49us/step - loss: 0.3345 - val_loss: 0.3386\n",
      "\n",
      "Epoch 00152: val_loss improved from 0.33877 to 0.33857, saving model to autoencode_digit.hdf5\n",
      "Epoch 153/5000\n",
      "1257/1257 [==============================] - 0s 49us/step - loss: 0.3339 - val_loss: 0.3383\n",
      "\n",
      "Epoch 00153: val_loss improved from 0.33857 to 0.33831, saving model to autoencode_digit.hdf5\n",
      "Epoch 154/5000\n",
      "1257/1257 [==============================] - 0s 44us/step - loss: 0.3340 - val_loss: 0.3381\n",
      "\n",
      "Epoch 00154: val_loss improved from 0.33831 to 0.33811, saving model to autoencode_digit.hdf5\n",
      "Epoch 155/5000\n",
      "1257/1257 [==============================] - 0s 50us/step - loss: 0.3337 - val_loss: 0.3387\n",
      "\n",
      "Epoch 00155: val_loss did not improve from 0.33811\n",
      "Epoch 156/5000\n",
      "1257/1257 [==============================] - 0s 45us/step - loss: 0.3340 - val_loss: 0.3386\n",
      "\n",
      "Epoch 00156: val_loss did not improve from 0.33811\n",
      "Epoch 157/5000\n",
      "1257/1257 [==============================] - 0s 44us/step - loss: 0.3338 - val_loss: 0.3389\n",
      "\n",
      "Epoch 00157: val_loss did not improve from 0.33811\n",
      "Epoch 158/5000\n",
      "1257/1257 [==============================] - 0s 44us/step - loss: 0.3337 - val_loss: 0.3384\n",
      "\n",
      "Epoch 00158: val_loss did not improve from 0.33811\n",
      "Epoch 159/5000\n",
      "1257/1257 [==============================] - 0s 50us/step - loss: 0.3334 - val_loss: 0.3382\n",
      "\n",
      "Epoch 00159: val_loss did not improve from 0.33811\n",
      "Epoch 160/5000\n",
      "1257/1257 [==============================] - 0s 48us/step - loss: 0.3336 - val_loss: 0.3382\n",
      "\n",
      "Epoch 00160: val_loss did not improve from 0.33811\n",
      "Epoch 161/5000\n",
      "1257/1257 [==============================] - 0s 45us/step - loss: 0.3334 - val_loss: 0.3379\n",
      "\n",
      "Epoch 00161: val_loss improved from 0.33811 to 0.33785, saving model to autoencode_digit.hdf5\n",
      "Epoch 162/5000\n",
      "1257/1257 [==============================] - 0s 44us/step - loss: 0.3333 - val_loss: 0.3376\n",
      "\n",
      "Epoch 00162: val_loss improved from 0.33785 to 0.33759, saving model to autoencode_digit.hdf5\n",
      "Epoch 163/5000\n",
      "1257/1257 [==============================] - 0s 48us/step - loss: 0.3334 - val_loss: 0.3382\n",
      "\n",
      "Epoch 00163: val_loss did not improve from 0.33759\n",
      "Epoch 164/5000\n",
      "1257/1257 [==============================] - 0s 49us/step - loss: 0.3333 - val_loss: 0.3372\n",
      "\n",
      "Epoch 00164: val_loss improved from 0.33759 to 0.33715, saving model to autoencode_digit.hdf5\n",
      "Epoch 165/5000\n",
      "1257/1257 [==============================] - 0s 45us/step - loss: 0.3328 - val_loss: 0.3377\n",
      "\n",
      "Epoch 00165: val_loss did not improve from 0.33715\n",
      "Epoch 166/5000\n",
      "1257/1257 [==============================] - 0s 50us/step - loss: 0.3331 - val_loss: 0.3369\n",
      "\n",
      "Epoch 00166: val_loss improved from 0.33715 to 0.33686, saving model to autoencode_digit.hdf5\n",
      "Epoch 167/5000\n",
      "1257/1257 [==============================] - 0s 57us/step - loss: 0.3329 - val_loss: 0.3370\n",
      "\n",
      "Epoch 00167: val_loss did not improve from 0.33686\n",
      "Epoch 168/5000\n",
      "1257/1257 [==============================] - 0s 51us/step - loss: 0.3328 - val_loss: 0.3371\n",
      "\n",
      "Epoch 00168: val_loss did not improve from 0.33686\n",
      "Epoch 169/5000\n",
      "1257/1257 [==============================] - 0s 50us/step - loss: 0.3326 - val_loss: 0.3369\n",
      "\n",
      "Epoch 00169: val_loss did not improve from 0.33686\n",
      "Epoch 170/5000\n",
      "1257/1257 [==============================] - 0s 54us/step - loss: 0.3326 - val_loss: 0.3365\n",
      "\n",
      "Epoch 00170: val_loss improved from 0.33686 to 0.33649, saving model to autoencode_digit.hdf5\n",
      "Epoch 171/5000\n",
      "1257/1257 [==============================] - 0s 50us/step - loss: 0.3327 - val_loss: 0.3364\n",
      "\n",
      "Epoch 00171: val_loss improved from 0.33649 to 0.33641, saving model to autoencode_digit.hdf5\n",
      "Epoch 172/5000\n",
      "1257/1257 [==============================] - 0s 48us/step - loss: 0.3326 - val_loss: 0.3379\n",
      "\n",
      "Epoch 00172: val_loss did not improve from 0.33641\n",
      "Epoch 173/5000\n",
      "1257/1257 [==============================] - 0s 53us/step - loss: 0.3326 - val_loss: 0.3384\n",
      "\n",
      "Epoch 00173: val_loss did not improve from 0.33641\n",
      "Epoch 174/5000\n",
      "1257/1257 [==============================] - 0s 49us/step - loss: 0.3325 - val_loss: 0.3365\n",
      "\n",
      "Epoch 00174: val_loss did not improve from 0.33641\n",
      "Epoch 175/5000\n",
      "1257/1257 [==============================] - 0s 49us/step - loss: 0.3326 - val_loss: 0.3366\n",
      "\n",
      "Epoch 00175: val_loss did not improve from 0.33641\n",
      "Epoch 176/5000\n",
      "1257/1257 [==============================] - 0s 49us/step - loss: 0.3324 - val_loss: 0.3368\n",
      "\n",
      "Epoch 00176: val_loss did not improve from 0.33641\n",
      "Epoch 177/5000\n",
      "1257/1257 [==============================] - 0s 51us/step - loss: 0.3321 - val_loss: 0.3364\n",
      "\n",
      "Epoch 00177: val_loss improved from 0.33641 to 0.33638, saving model to autoencode_digit.hdf5\n",
      "Epoch 178/5000\n",
      "1257/1257 [==============================] - 0s 49us/step - loss: 0.3320 - val_loss: 0.3362\n",
      "\n",
      "Epoch 00178: val_loss improved from 0.33638 to 0.33618, saving model to autoencode_digit.hdf5\n",
      "Epoch 179/5000\n",
      "1257/1257 [==============================] - 0s 50us/step - loss: 0.3321 - val_loss: 0.3366\n",
      "\n",
      "Epoch 00179: val_loss did not improve from 0.33618\n",
      "Epoch 180/5000\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "1257/1257 [==============================] - 0s 50us/step - loss: 0.3318 - val_loss: 0.3367\n",
      "\n",
      "Epoch 00180: val_loss did not improve from 0.33618\n",
      "Epoch 181/5000\n",
      "1257/1257 [==============================] - 0s 48us/step - loss: 0.3322 - val_loss: 0.3368\n",
      "\n",
      "Epoch 00181: val_loss did not improve from 0.33618\n",
      "Epoch 182/5000\n",
      "1257/1257 [==============================] - 0s 44us/step - loss: 0.3322 - val_loss: 0.3366\n",
      "\n",
      "Epoch 00182: val_loss did not improve from 0.33618\n",
      "Epoch 183/5000\n",
      "1257/1257 [==============================] - 0s 46us/step - loss: 0.3324 - val_loss: 0.3362\n",
      "\n",
      "Epoch 00183: val_loss did not improve from 0.33618\n",
      "Epoch 184/5000\n",
      "1257/1257 [==============================] - 0s 44us/step - loss: 0.3320 - val_loss: 0.3369\n",
      "\n",
      "Epoch 00184: val_loss did not improve from 0.33618\n",
      "Epoch 185/5000\n",
      "1257/1257 [==============================] - 0s 44us/step - loss: 0.3324 - val_loss: 0.3361\n",
      "\n",
      "Epoch 00185: val_loss improved from 0.33618 to 0.33615, saving model to autoencode_digit.hdf5\n",
      "Epoch 186/5000\n",
      "1257/1257 [==============================] - 0s 44us/step - loss: 0.3317 - val_loss: 0.3363\n",
      "\n",
      "Epoch 00186: val_loss did not improve from 0.33615\n",
      "Epoch 187/5000\n",
      "1257/1257 [==============================] - 0s 52us/step - loss: 0.3315 - val_loss: 0.3360\n",
      "\n",
      "Epoch 00187: val_loss improved from 0.33615 to 0.33601, saving model to autoencode_digit.hdf5\n",
      "Epoch 188/5000\n",
      "1257/1257 [==============================] - 0s 45us/step - loss: 0.3318 - val_loss: 0.3368\n",
      "\n",
      "Epoch 00188: val_loss did not improve from 0.33601\n",
      "Epoch 189/5000\n",
      "1257/1257 [==============================] - 0s 43us/step - loss: 0.3321 - val_loss: 0.3361\n",
      "\n",
      "Epoch 00189: val_loss did not improve from 0.33601\n",
      "Epoch 190/5000\n",
      "1257/1257 [==============================] - 0s 43us/step - loss: 0.3317 - val_loss: 0.3359\n",
      "\n",
      "Epoch 00190: val_loss improved from 0.33601 to 0.33591, saving model to autoencode_digit.hdf5\n",
      "Epoch 191/5000\n",
      "1257/1257 [==============================] - 0s 43us/step - loss: 0.3313 - val_loss: 0.3358\n",
      "\n",
      "Epoch 00191: val_loss improved from 0.33591 to 0.33575, saving model to autoencode_digit.hdf5\n",
      "Epoch 192/5000\n",
      "1257/1257 [==============================] - 0s 49us/step - loss: 0.3314 - val_loss: 0.3360\n",
      "\n",
      "Epoch 00192: val_loss did not improve from 0.33575\n",
      "Epoch 193/5000\n",
      "1257/1257 [==============================] - 0s 49us/step - loss: 0.3315 - val_loss: 0.3355\n",
      "\n",
      "Epoch 00193: val_loss improved from 0.33575 to 0.33553, saving model to autoencode_digit.hdf5\n",
      "Epoch 194/5000\n",
      "1257/1257 [==============================] - 0s 45us/step - loss: 0.3311 - val_loss: 0.3358\n",
      "\n",
      "Epoch 00194: val_loss did not improve from 0.33553\n",
      "Epoch 195/5000\n",
      "1257/1257 [==============================] - 0s 43us/step - loss: 0.3311 - val_loss: 0.3356\n",
      "\n",
      "Epoch 00195: val_loss did not improve from 0.33553\n",
      "Epoch 196/5000\n",
      "1257/1257 [==============================] - 0s 48us/step - loss: 0.3311 - val_loss: 0.3359\n",
      "\n",
      "Epoch 00196: val_loss did not improve from 0.33553\n",
      "Epoch 197/5000\n",
      "1257/1257 [==============================] - 0s 45us/step - loss: 0.3311 - val_loss: 0.3362\n",
      "\n",
      "Epoch 00197: val_loss did not improve from 0.33553\n",
      "Epoch 198/5000\n",
      "1257/1257 [==============================] - 0s 44us/step - loss: 0.3314 - val_loss: 0.3361\n",
      "\n",
      "Epoch 00198: val_loss did not improve from 0.33553\n",
      "Epoch 199/5000\n",
      "1257/1257 [==============================] - 0s 53us/step - loss: 0.3314 - val_loss: 0.3357\n",
      "\n",
      "Epoch 00199: val_loss did not improve from 0.33553\n",
      "Epoch 200/5000\n",
      "1257/1257 [==============================] - 0s 71us/step - loss: 0.3313 - val_loss: 0.3354\n",
      "\n",
      "Epoch 00200: val_loss improved from 0.33553 to 0.33538, saving model to autoencode_digit.hdf5\n",
      "Epoch 201/5000\n",
      "1257/1257 [==============================] - 0s 55us/step - loss: 0.3307 - val_loss: 0.3350\n",
      "\n",
      "Epoch 00201: val_loss improved from 0.33538 to 0.33501, saving model to autoencode_digit.hdf5\n",
      "Epoch 202/5000\n",
      "1257/1257 [==============================] - 0s 54us/step - loss: 0.3307 - val_loss: 0.3352\n",
      "\n",
      "Epoch 00202: val_loss did not improve from 0.33501\n",
      "Epoch 203/5000\n",
      "1257/1257 [==============================] - 0s 61us/step - loss: 0.3306 - val_loss: 0.3362\n",
      "\n",
      "Epoch 00203: val_loss did not improve from 0.33501\n",
      "Epoch 204/5000\n",
      "1257/1257 [==============================] - 0s 55us/step - loss: 0.3313 - val_loss: 0.3354\n",
      "\n",
      "Epoch 00204: val_loss did not improve from 0.33501\n",
      "Epoch 205/5000\n",
      "1257/1257 [==============================] - 0s 60us/step - loss: 0.3307 - val_loss: 0.3356\n",
      "\n",
      "Epoch 00205: val_loss did not improve from 0.33501\n",
      "Epoch 206/5000\n",
      "1257/1257 [==============================] - 0s 59us/step - loss: 0.3303 - val_loss: 0.3354\n",
      "\n",
      "Epoch 00206: val_loss did not improve from 0.33501\n",
      "Epoch 207/5000\n",
      "1257/1257 [==============================] - 0s 57us/step - loss: 0.3302 - val_loss: 0.3353\n",
      "\n",
      "Epoch 00207: val_loss did not improve from 0.33501\n",
      "Epoch 208/5000\n",
      "1257/1257 [==============================] - 0s 54us/step - loss: 0.3301 - val_loss: 0.3350\n",
      "\n",
      "Epoch 00208: val_loss improved from 0.33501 to 0.33501, saving model to autoencode_digit.hdf5\n",
      "Epoch 209/5000\n",
      "1257/1257 [==============================] - 0s 51us/step - loss: 0.3302 - val_loss: 0.3356\n",
      "\n",
      "Epoch 00209: val_loss did not improve from 0.33501\n",
      "Epoch 210/5000\n",
      "1257/1257 [==============================] - 0s 53us/step - loss: 0.3304 - val_loss: 0.3355\n",
      "\n",
      "Epoch 00210: val_loss did not improve from 0.33501\n",
      "Epoch 211/5000\n",
      "1257/1257 [==============================] - 0s 53us/step - loss: 0.3305 - val_loss: 0.3352\n",
      "\n",
      "Epoch 00211: val_loss did not improve from 0.33501\n",
      "Epoch 212/5000\n",
      "1257/1257 [==============================] - 0s 58us/step - loss: 0.3303 - val_loss: 0.3350\n",
      "\n",
      "Epoch 00212: val_loss did not improve from 0.33501\n",
      "Epoch 213/5000\n",
      "1257/1257 [==============================] - 0s 57us/step - loss: 0.3299 - val_loss: 0.3356\n",
      "\n",
      "Epoch 00213: val_loss did not improve from 0.33501\n",
      "Epoch 214/5000\n",
      "1257/1257 [==============================] - 0s 60us/step - loss: 0.3305 - val_loss: 0.3372\n",
      "\n",
      "Epoch 00214: val_loss did not improve from 0.33501\n",
      "Epoch 215/5000\n",
      "1257/1257 [==============================] - 0s 58us/step - loss: 0.3315 - val_loss: 0.3358\n",
      "\n",
      "Epoch 00215: val_loss did not improve from 0.33501\n",
      "Epoch 216/5000\n",
      "1257/1257 [==============================] - 0s 52us/step - loss: 0.3305 - val_loss: 0.3357\n",
      "\n",
      "Epoch 00216: val_loss did not improve from 0.33501\n",
      "Epoch 217/5000\n",
      "1257/1257 [==============================] - 0s 57us/step - loss: 0.3306 - val_loss: 0.3349\n",
      "\n",
      "Epoch 00217: val_loss improved from 0.33501 to 0.33486, saving model to autoencode_digit.hdf5\n",
      "Epoch 218/5000\n",
      "1257/1257 [==============================] - 0s 59us/step - loss: 0.3302 - val_loss: 0.3349\n",
      "\n",
      "Epoch 00218: val_loss did not improve from 0.33486\n",
      "Epoch 219/5000\n",
      "1257/1257 [==============================] - 0s 52us/step - loss: 0.3298 - val_loss: 0.3346\n",
      "\n",
      "Epoch 00219: val_loss improved from 0.33486 to 0.33458, saving model to autoencode_digit.hdf5\n",
      "Epoch 220/5000\n",
      "1257/1257 [==============================] - 0s 54us/step - loss: 0.3297 - val_loss: 0.3347\n",
      "\n",
      "Epoch 00220: val_loss did not improve from 0.33458\n",
      "Epoch 221/5000\n",
      "1257/1257 [==============================] - 0s 59us/step - loss: 0.3297 - val_loss: 0.3350\n",
      "\n",
      "Epoch 00221: val_loss did not improve from 0.33458\n",
      "Epoch 222/5000\n",
      "1257/1257 [==============================] - 0s 52us/step - loss: 0.3297 - val_loss: 0.3341\n",
      "\n",
      "Epoch 00222: val_loss improved from 0.33458 to 0.33413, saving model to autoencode_digit.hdf5\n",
      "Epoch 223/5000\n",
      "1257/1257 [==============================] - 0s 59us/step - loss: 0.3295 - val_loss: 0.3347\n",
      "\n",
      "Epoch 00223: val_loss did not improve from 0.33413\n",
      "Epoch 224/5000\n",
      "1257/1257 [==============================] - 0s 49us/step - loss: 0.3294 - val_loss: 0.3347\n",
      "\n",
      "Epoch 00224: val_loss did not improve from 0.33413\n",
      "Epoch 225/5000\n",
      "1257/1257 [==============================] - 0s 48us/step - loss: 0.3298 - val_loss: 0.3348\n",
      "\n",
      "Epoch 00225: val_loss did not improve from 0.33413\n",
      "Epoch 226/5000\n",
      "1257/1257 [==============================] - 0s 49us/step - loss: 0.3296 - val_loss: 0.3337\n",
      "\n",
      "Epoch 00226: val_loss improved from 0.33413 to 0.33368, saving model to autoencode_digit.hdf5\n",
      "Epoch 227/5000\n",
      "1257/1257 [==============================] - 0s 44us/step - loss: 0.3291 - val_loss: 0.3345\n",
      "\n",
      "Epoch 00227: val_loss did not improve from 0.33368\n",
      "Epoch 228/5000\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "1257/1257 [==============================] - 0s 45us/step - loss: 0.3295 - val_loss: 0.3365\n",
      "\n",
      "Epoch 00228: val_loss did not improve from 0.33368\n",
      "Epoch 229/5000\n",
      "1257/1257 [==============================] - 0s 48us/step - loss: 0.3298 - val_loss: 0.3344\n",
      "\n",
      "Epoch 00229: val_loss did not improve from 0.33368\n",
      "Epoch 230/5000\n",
      "1257/1257 [==============================] - 0s 43us/step - loss: 0.3294 - val_loss: 0.3341\n",
      "\n",
      "Epoch 00230: val_loss did not improve from 0.33368\n",
      "Epoch 231/5000\n",
      "1257/1257 [==============================] - 0s 51us/step - loss: 0.3290 - val_loss: 0.3340\n",
      "\n",
      "Epoch 00231: val_loss did not improve from 0.33368\n",
      "Epoch 232/5000\n",
      "1257/1257 [==============================] - 0s 45us/step - loss: 0.3291 - val_loss: 0.3342\n",
      "\n",
      "Epoch 00232: val_loss did not improve from 0.33368\n",
      "Epoch 233/5000\n",
      "1257/1257 [==============================] - 0s 45us/step - loss: 0.3289 - val_loss: 0.3337\n",
      "\n",
      "Epoch 00233: val_loss improved from 0.33368 to 0.33366, saving model to autoencode_digit.hdf5\n",
      "Epoch 234/5000\n",
      "1257/1257 [==============================] - 0s 44us/step - loss: 0.3291 - val_loss: 0.3343\n",
      "\n",
      "Epoch 00234: val_loss did not improve from 0.33366\n",
      "Epoch 235/5000\n",
      "1257/1257 [==============================] - 0s 46us/step - loss: 0.3291 - val_loss: 0.3342\n",
      "\n",
      "Epoch 00235: val_loss did not improve from 0.33366\n",
      "Epoch 236/5000\n",
      "1257/1257 [==============================] - 0s 43us/step - loss: 0.3293 - val_loss: 0.3346\n",
      "\n",
      "Epoch 00236: val_loss did not improve from 0.33366\n",
      "Epoch 237/5000\n",
      "1257/1257 [==============================] - 0s 44us/step - loss: 0.3290 - val_loss: 0.3342\n",
      "\n",
      "Epoch 00237: val_loss did not improve from 0.33366\n",
      "Epoch 238/5000\n",
      "1257/1257 [==============================] - 0s 45us/step - loss: 0.3286 - val_loss: 0.3345\n",
      "\n",
      "Epoch 00238: val_loss did not improve from 0.33366\n",
      "Epoch 239/5000\n",
      "1257/1257 [==============================] - 0s 53us/step - loss: 0.3287 - val_loss: 0.3337\n",
      "\n",
      "Epoch 00239: val_loss did not improve from 0.33366\n",
      "Epoch 240/5000\n",
      "1257/1257 [==============================] - 0s 44us/step - loss: 0.3288 - val_loss: 0.3339\n",
      "\n",
      "Epoch 00240: val_loss did not improve from 0.33366\n",
      "Epoch 241/5000\n",
      "1257/1257 [==============================] - 0s 49us/step - loss: 0.3285 - val_loss: 0.3332\n",
      "\n",
      "Epoch 00241: val_loss improved from 0.33366 to 0.33324, saving model to autoencode_digit.hdf5\n",
      "Epoch 242/5000\n",
      "1257/1257 [==============================] - 0s 49us/step - loss: 0.3286 - val_loss: 0.3336\n",
      "\n",
      "Epoch 00242: val_loss did not improve from 0.33324\n",
      "Epoch 243/5000\n",
      "1257/1257 [==============================] - 0s 49us/step - loss: 0.3282 - val_loss: 0.3338\n",
      "\n",
      "Epoch 00243: val_loss did not improve from 0.33324\n",
      "Epoch 244/5000\n",
      "1257/1257 [==============================] - 0s 45us/step - loss: 0.3284 - val_loss: 0.3342\n",
      "\n",
      "Epoch 00244: val_loss did not improve from 0.33324\n",
      "Epoch 245/5000\n",
      "1257/1257 [==============================] - 0s 48us/step - loss: 0.3283 - val_loss: 0.3343\n",
      "\n",
      "Epoch 00245: val_loss did not improve from 0.33324\n",
      "Epoch 246/5000\n",
      "1257/1257 [==============================] - 0s 56us/step - loss: 0.3284 - val_loss: 0.3331\n",
      "\n",
      "Epoch 00246: val_loss improved from 0.33324 to 0.33308, saving model to autoencode_digit.hdf5\n",
      "Epoch 247/5000\n",
      "1257/1257 [==============================] - 0s 50us/step - loss: 0.3281 - val_loss: 0.3339\n",
      "\n",
      "Epoch 00247: val_loss did not improve from 0.33308\n",
      "Epoch 248/5000\n",
      "1257/1257 [==============================] - 0s 44us/step - loss: 0.3284 - val_loss: 0.3340\n",
      "\n",
      "Epoch 00248: val_loss did not improve from 0.33308\n",
      "Epoch 249/5000\n",
      "1257/1257 [==============================] - 0s 49us/step - loss: 0.3280 - val_loss: 0.3338\n",
      "\n",
      "Epoch 00249: val_loss did not improve from 0.33308\n",
      "Epoch 250/5000\n",
      "1257/1257 [==============================] - 0s 49us/step - loss: 0.3283 - val_loss: 0.3333\n",
      "\n",
      "Epoch 00250: val_loss did not improve from 0.33308\n",
      "Epoch 251/5000\n",
      "1257/1257 [==============================] - 0s 44us/step - loss: 0.3280 - val_loss: 0.3332\n",
      "\n",
      "Epoch 00251: val_loss did not improve from 0.33308\n",
      "Epoch 252/5000\n",
      "1257/1257 [==============================] - 0s 49us/step - loss: 0.3279 - val_loss: 0.3332\n",
      "\n",
      "Epoch 00252: val_loss did not improve from 0.33308\n",
      "Epoch 253/5000\n",
      "1257/1257 [==============================] - 0s 54us/step - loss: 0.3280 - val_loss: 0.3332\n",
      "\n",
      "Epoch 00253: val_loss did not improve from 0.33308\n",
      "Epoch 254/5000\n",
      "1257/1257 [==============================] - 0s 48us/step - loss: 0.3278 - val_loss: 0.3331\n",
      "\n",
      "Epoch 00254: val_loss did not improve from 0.33308\n",
      "Epoch 255/5000\n",
      "1257/1257 [==============================] - 0s 44us/step - loss: 0.3284 - val_loss: 0.3327\n",
      "\n",
      "Epoch 00255: val_loss improved from 0.33308 to 0.33272, saving model to autoencode_digit.hdf5\n",
      "Epoch 256/5000\n",
      "1257/1257 [==============================] - ETA: 0s - loss: 0.326 - 0s 50us/step - loss: 0.3275 - val_loss: 0.3328\n",
      "\n",
      "Epoch 00256: val_loss did not improve from 0.33272\n",
      "Epoch 257/5000\n",
      "1257/1257 [==============================] - 0s 44us/step - loss: 0.3278 - val_loss: 0.3328\n",
      "\n",
      "Epoch 00257: val_loss did not improve from 0.33272\n",
      "Epoch 258/5000\n",
      "1257/1257 [==============================] - 0s 44us/step - loss: 0.3279 - val_loss: 0.3335\n",
      "\n",
      "Epoch 00258: val_loss did not improve from 0.33272\n",
      "Epoch 259/5000\n",
      "1257/1257 [==============================] - ETA: 0s - loss: 0.333 - 0s 45us/step - loss: 0.3276 - val_loss: 0.3328\n",
      "\n",
      "Epoch 00259: val_loss did not improve from 0.33272\n",
      "Epoch 260/5000\n",
      "1257/1257 [==============================] - 0s 49us/step - loss: 0.3274 - val_loss: 0.3326\n",
      "\n",
      "Epoch 00260: val_loss improved from 0.33272 to 0.33256, saving model to autoencode_digit.hdf5\n",
      "Epoch 261/5000\n",
      "1257/1257 [==============================] - 0s 49us/step - loss: 0.3276 - val_loss: 0.3329\n",
      "\n",
      "Epoch 00261: val_loss did not improve from 0.33256\n",
      "Epoch 262/5000\n",
      "1257/1257 [==============================] - 0s 48us/step - loss: 0.3274 - val_loss: 0.3330\n",
      "\n",
      "Epoch 00262: val_loss did not improve from 0.33256\n",
      "Epoch 263/5000\n",
      "1257/1257 [==============================] - 0s 49us/step - loss: 0.3274 - val_loss: 0.3324\n",
      "\n",
      "Epoch 00263: val_loss improved from 0.33256 to 0.33242, saving model to autoencode_digit.hdf5\n",
      "Epoch 264/5000\n",
      "1257/1257 [==============================] - 0s 49us/step - loss: 0.3277 - val_loss: 0.3326\n",
      "\n",
      "Epoch 00264: val_loss did not improve from 0.33242\n",
      "Epoch 265/5000\n",
      "1257/1257 [==============================] - 0s 50us/step - loss: 0.3275 - val_loss: 0.3326\n",
      "\n",
      "Epoch 00265: val_loss did not improve from 0.33242\n",
      "Epoch 266/5000\n",
      "1257/1257 [==============================] - 0s 48us/step - loss: 0.3276 - val_loss: 0.3325\n",
      "\n",
      "Epoch 00266: val_loss did not improve from 0.33242\n",
      "Epoch 267/5000\n",
      "1257/1257 [==============================] - 0s 55us/step - loss: 0.3273 - val_loss: 0.3333\n",
      "\n",
      "Epoch 00267: val_loss did not improve from 0.33242\n",
      "Epoch 268/5000\n",
      "1257/1257 [==============================] - 0s 49us/step - loss: 0.3280 - val_loss: 0.3328\n",
      "\n",
      "Epoch 00268: val_loss did not improve from 0.33242\n",
      "Epoch 269/5000\n",
      "1257/1257 [==============================] - 0s 51us/step - loss: 0.3273 - val_loss: 0.3324\n",
      "\n",
      "Epoch 00269: val_loss improved from 0.33242 to 0.33237, saving model to autoencode_digit.hdf5\n",
      "Epoch 270/5000\n",
      "1257/1257 [==============================] - 0s 49us/step - loss: 0.3273 - val_loss: 0.3332\n",
      "\n",
      "Epoch 00270: val_loss did not improve from 0.33237\n",
      "Epoch 271/5000\n",
      "1257/1257 [==============================] - 0s 53us/step - loss: 0.3272 - val_loss: 0.3330\n",
      "\n",
      "Epoch 00271: val_loss did not improve from 0.33237\n",
      "Epoch 272/5000\n",
      "1257/1257 [==============================] - 0s 45us/step - loss: 0.3269 - val_loss: 0.3322\n",
      "\n",
      "Epoch 00272: val_loss improved from 0.33237 to 0.33225, saving model to autoencode_digit.hdf5\n",
      "Epoch 273/5000\n",
      "1257/1257 [==============================] - 0s 61us/step - loss: 0.3269 - val_loss: 0.3318\n",
      "\n",
      "Epoch 00273: val_loss improved from 0.33225 to 0.33181, saving model to autoencode_digit.hdf5\n",
      "Epoch 274/5000\n",
      "1257/1257 [==============================] - 0s 52us/step - loss: 0.3268 - val_loss: 0.3324\n",
      "\n",
      "Epoch 00274: val_loss did not improve from 0.33181\n",
      "Epoch 275/5000\n",
      "1257/1257 [==============================] - 0s 51us/step - loss: 0.3271 - val_loss: 0.3333\n",
      "\n",
      "Epoch 00275: val_loss did not improve from 0.33181\n",
      "Epoch 276/5000\n",
      "1257/1257 [==============================] - 0s 52us/step - loss: 0.3270 - val_loss: 0.3328\n",
      "\n",
      "Epoch 00276: val_loss did not improve from 0.33181\n",
      "Epoch 277/5000\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "1257/1257 [==============================] - 0s 54us/step - loss: 0.3268 - val_loss: 0.3323\n",
      "\n",
      "Epoch 00277: val_loss did not improve from 0.33181\n",
      "Epoch 278/5000\n",
      "1257/1257 [==============================] - 0s 54us/step - loss: 0.3268 - val_loss: 0.3320\n",
      "\n",
      "Epoch 00278: val_loss did not improve from 0.33181\n",
      "Epoch 279/5000\n",
      "1257/1257 [==============================] - 0s 53us/step - loss: 0.3267 - val_loss: 0.3321\n",
      "\n",
      "Epoch 00279: val_loss did not improve from 0.33181\n",
      "Epoch 280/5000\n",
      "1257/1257 [==============================] - 0s 57us/step - loss: 0.3267 - val_loss: 0.3322\n",
      "\n",
      "Epoch 00280: val_loss did not improve from 0.33181\n",
      "Epoch 281/5000\n",
      "1257/1257 [==============================] - 0s 49us/step - loss: 0.3269 - val_loss: 0.3326\n",
      "\n",
      "Epoch 00281: val_loss did not improve from 0.33181\n",
      "Epoch 282/5000\n",
      "1257/1257 [==============================] - 0s 49us/step - loss: 0.3267 - val_loss: 0.3330\n",
      "\n",
      "Epoch 00282: val_loss did not improve from 0.33181\n",
      "Epoch 283/5000\n",
      "1257/1257 [==============================] - 0s 51us/step - loss: 0.3269 - val_loss: 0.3326\n",
      "\n",
      "Epoch 00283: val_loss did not improve from 0.33181\n",
      "Epoch 284/5000\n",
      "1257/1257 [==============================] - 0s 50us/step - loss: 0.3269 - val_loss: 0.3319\n",
      "\n",
      "Epoch 00284: val_loss did not improve from 0.33181\n",
      "Epoch 285/5000\n",
      "1257/1257 [==============================] - 0s 53us/step - loss: 0.3265 - val_loss: 0.3320\n",
      "\n",
      "Epoch 00285: val_loss did not improve from 0.33181\n",
      "Epoch 286/5000\n",
      "1257/1257 [==============================] - 0s 50us/step - loss: 0.3263 - val_loss: 0.3321\n",
      "\n",
      "Epoch 00286: val_loss did not improve from 0.33181\n",
      "Epoch 287/5000\n",
      "1257/1257 [==============================] - 0s 50us/step - loss: 0.3263 - val_loss: 0.3323\n",
      "\n",
      "Epoch 00287: val_loss did not improve from 0.33181\n",
      "Epoch 288/5000\n",
      "1257/1257 [==============================] - 0s 51us/step - loss: 0.3267 - val_loss: 0.3320\n",
      "\n",
      "Epoch 00288: val_loss did not improve from 0.33181\n",
      "Epoch 289/5000\n",
      "1257/1257 [==============================] - 0s 51us/step - loss: 0.3264 - val_loss: 0.3327\n",
      "\n",
      "Epoch 00289: val_loss did not improve from 0.33181\n",
      "Epoch 290/5000\n",
      "1257/1257 [==============================] - 0s 51us/step - loss: 0.3262 - val_loss: 0.3323\n",
      "\n",
      "Epoch 00290: val_loss did not improve from 0.33181\n",
      "Epoch 291/5000\n",
      "1257/1257 [==============================] - 0s 50us/step - loss: 0.3265 - val_loss: 0.3316\n",
      "\n",
      "Epoch 00291: val_loss improved from 0.33181 to 0.33159, saving model to autoencode_digit.hdf5\n",
      "Epoch 292/5000\n",
      "1257/1257 [==============================] - 0s 49us/step - loss: 0.3261 - val_loss: 0.3317\n",
      "\n",
      "Epoch 00292: val_loss did not improve from 0.33159\n",
      "Epoch 293/5000\n",
      "1257/1257 [==============================] - 0s 61us/step - loss: 0.3261 - val_loss: 0.3315\n",
      "\n",
      "Epoch 00293: val_loss improved from 0.33159 to 0.33153, saving model to autoencode_digit.hdf5\n",
      "Epoch 294/5000\n",
      "1257/1257 [==============================] - 0s 51us/step - loss: 0.3260 - val_loss: 0.3313\n",
      "\n",
      "Epoch 00294: val_loss improved from 0.33153 to 0.33133, saving model to autoencode_digit.hdf5\n",
      "Epoch 295/5000\n",
      "1257/1257 [==============================] - 0s 51us/step - loss: 0.3263 - val_loss: 0.3320\n",
      "\n",
      "Epoch 00295: val_loss did not improve from 0.33133\n",
      "Epoch 296/5000\n",
      "1257/1257 [==============================] - 0s 51us/step - loss: 0.3264 - val_loss: 0.3338\n",
      "\n",
      "Epoch 00296: val_loss did not improve from 0.33133\n",
      "Epoch 297/5000\n",
      "1257/1257 [==============================] - 0s 61us/step - loss: 0.3263 - val_loss: 0.3326\n",
      "\n",
      "Epoch 00297: val_loss did not improve from 0.33133\n",
      "Epoch 298/5000\n",
      "1257/1257 [==============================] - 0s 52us/step - loss: 0.3265 - val_loss: 0.3325\n",
      "\n",
      "Epoch 00298: val_loss did not improve from 0.33133\n",
      "Epoch 299/5000\n",
      "1257/1257 [==============================] - 0s 49us/step - loss: 0.3264 - val_loss: 0.3323\n",
      "\n",
      "Epoch 00299: val_loss did not improve from 0.33133\n",
      "Epoch 300/5000\n",
      "1257/1257 [==============================] - 0s 49us/step - loss: 0.3259 - val_loss: 0.3315\n",
      "\n",
      "Epoch 00300: val_loss did not improve from 0.33133\n",
      "Epoch 301/5000\n",
      "1257/1257 [==============================] - 0s 51us/step - loss: 0.3260 - val_loss: 0.3318\n",
      "\n",
      "Epoch 00301: val_loss did not improve from 0.33133\n",
      "Epoch 302/5000\n",
      "1257/1257 [==============================] - 0s 55us/step - loss: 0.3261 - val_loss: 0.3316\n",
      "\n",
      "Epoch 00302: val_loss did not improve from 0.33133\n",
      "Epoch 303/5000\n",
      "1257/1257 [==============================] - 0s 57us/step - loss: 0.3258 - val_loss: 0.3317\n",
      "\n",
      "Epoch 00303: val_loss did not improve from 0.33133\n",
      "Epoch 304/5000\n",
      "1257/1257 [==============================] - 0s 59us/step - loss: 0.3260 - val_loss: 0.3316\n",
      "\n",
      "Epoch 00304: val_loss did not improve from 0.33133\n",
      "Epoch 305/5000\n",
      "1257/1257 [==============================] - 0s 50us/step - loss: 0.3258 - val_loss: 0.3319\n",
      "\n",
      "Epoch 00305: val_loss did not improve from 0.33133\n",
      "Epoch 306/5000\n",
      "1257/1257 [==============================] - 0s 55us/step - loss: 0.3256 - val_loss: 0.3316\n",
      "\n",
      "Epoch 00306: val_loss did not improve from 0.33133\n",
      "Epoch 307/5000\n",
      "1257/1257 [==============================] - 0s 53us/step - loss: 0.3253 - val_loss: 0.3319\n",
      "\n",
      "Epoch 00307: val_loss did not improve from 0.33133\n",
      "Epoch 308/5000\n",
      "1257/1257 [==============================] - 0s 56us/step - loss: 0.3254 - val_loss: 0.3315\n",
      "\n",
      "Epoch 00308: val_loss did not improve from 0.33133\n",
      "Epoch 309/5000\n",
      "1257/1257 [==============================] - 0s 56us/step - loss: 0.3257 - val_loss: 0.3323\n",
      "\n",
      "Epoch 00309: val_loss did not improve from 0.33133\n",
      "Epoch 310/5000\n",
      "1257/1257 [==============================] - 0s 52us/step - loss: 0.3256 - val_loss: 0.3316\n",
      "\n",
      "Epoch 00310: val_loss did not improve from 0.33133\n",
      "Epoch 311/5000\n",
      "1257/1257 [==============================] - 0s 50us/step - loss: 0.3257 - val_loss: 0.3308\n",
      "\n",
      "Epoch 00311: val_loss improved from 0.33133 to 0.33076, saving model to autoencode_digit.hdf5\n",
      "Epoch 312/5000\n",
      "1257/1257 [==============================] - 0s 59us/step - loss: 0.3260 - val_loss: 0.3316\n",
      "\n",
      "Epoch 00312: val_loss did not improve from 0.33076\n",
      "Epoch 313/5000\n",
      "1257/1257 [==============================] - 0s 55us/step - loss: 0.3255 - val_loss: 0.3312\n",
      "\n",
      "Epoch 00313: val_loss did not improve from 0.33076\n",
      "Epoch 314/5000\n",
      "1257/1257 [==============================] - 0s 51us/step - loss: 0.3253 - val_loss: 0.3318\n",
      "\n",
      "Epoch 00314: val_loss did not improve from 0.33076\n",
      "Epoch 315/5000\n",
      "1257/1257 [==============================] - 0s 49us/step - loss: 0.3256 - val_loss: 0.3318\n",
      "\n",
      "Epoch 00315: val_loss did not improve from 0.33076\n",
      "Epoch 316/5000\n",
      "1257/1257 [==============================] - 0s 50us/step - loss: 0.3254 - val_loss: 0.3316\n",
      "\n",
      "Epoch 00316: val_loss did not improve from 0.33076\n",
      "Epoch 317/5000\n",
      "1257/1257 [==============================] - 0s 59us/step - loss: 0.3255 - val_loss: 0.3319\n",
      "\n",
      "Epoch 00317: val_loss did not improve from 0.33076\n",
      "Epoch 318/5000\n",
      "1257/1257 [==============================] - 0s 54us/step - loss: 0.3252 - val_loss: 0.3311\n",
      "\n",
      "Epoch 00318: val_loss did not improve from 0.33076\n",
      "Epoch 319/5000\n",
      "1257/1257 [==============================] - 0s 53us/step - loss: 0.3253 - val_loss: 0.3311\n",
      "\n",
      "Epoch 00319: val_loss did not improve from 0.33076\n",
      "Epoch 320/5000\n",
      "1257/1257 [==============================] - 0s 50us/step - loss: 0.3255 - val_loss: 0.3319\n",
      "\n",
      "Epoch 00320: val_loss did not improve from 0.33076\n",
      "Epoch 321/5000\n",
      "1257/1257 [==============================] - 0s 50us/step - loss: 0.3257 - val_loss: 0.3317\n",
      "\n",
      "Epoch 00321: val_loss did not improve from 0.33076\n",
      "Epoch 322/5000\n",
      "1257/1257 [==============================] - 0s 60us/step - loss: 0.3252 - val_loss: 0.3314\n",
      "\n",
      "Epoch 00322: val_loss did not improve from 0.33076\n",
      "Epoch 323/5000\n",
      "1257/1257 [==============================] - 0s 53us/step - loss: 0.3255 - val_loss: 0.3317\n",
      "\n",
      "Epoch 00323: val_loss did not improve from 0.33076\n",
      "Epoch 324/5000\n",
      "1257/1257 [==============================] - 0s 56us/step - loss: 0.3250 - val_loss: 0.3316\n",
      "\n",
      "Epoch 00324: val_loss did not improve from 0.33076\n",
      "Epoch 325/5000\n",
      "1257/1257 [==============================] - 0s 55us/step - loss: 0.3250 - val_loss: 0.3316\n",
      "\n",
      "Epoch 00325: val_loss did not improve from 0.33076\n",
      "Epoch 326/5000\n",
      "1257/1257 [==============================] - 0s 52us/step - loss: 0.3251 - val_loss: 0.3310\n",
      "\n",
      "Epoch 00326: val_loss did not improve from 0.33076\n",
      "Epoch 327/5000\n",
      "1257/1257 [==============================] - 0s 53us/step - loss: 0.3252 - val_loss: 0.3316\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "\n",
      "Epoch 00327: val_loss did not improve from 0.33076\n",
      "Epoch 328/5000\n",
      "1257/1257 [==============================] - 0s 56us/step - loss: 0.3250 - val_loss: 0.3316\n",
      "\n",
      "Epoch 00328: val_loss did not improve from 0.33076\n",
      "Epoch 329/5000\n",
      "1257/1257 [==============================] - 0s 53us/step - loss: 0.3249 - val_loss: 0.3309\n",
      "\n",
      "Epoch 00329: val_loss did not improve from 0.33076\n",
      "Epoch 330/5000\n",
      "1257/1257 [==============================] - 0s 49us/step - loss: 0.3250 - val_loss: 0.3311\n",
      "\n",
      "Epoch 00330: val_loss did not improve from 0.33076\n",
      "Epoch 331/5000\n",
      "1257/1257 [==============================] - 0s 46us/step - loss: 0.3249 - val_loss: 0.3322\n",
      "\n",
      "Epoch 00331: val_loss did not improve from 0.33076\n",
      "Epoch 332/5000\n",
      "1257/1257 [==============================] - 0s 45us/step - loss: 0.3253 - val_loss: 0.3312\n",
      "\n",
      "Epoch 00332: val_loss did not improve from 0.33076\n",
      "Epoch 333/5000\n",
      "1257/1257 [==============================] - 0s 44us/step - loss: 0.3253 - val_loss: 0.3311\n",
      "\n",
      "Epoch 00333: val_loss did not improve from 0.33076\n",
      "Epoch 334/5000\n",
      "1257/1257 [==============================] - 0s 50us/step - loss: 0.3247 - val_loss: 0.3311\n",
      "\n",
      "Epoch 00334: val_loss did not improve from 0.33076\n",
      "Epoch 335/5000\n",
      "1257/1257 [==============================] - 0s 54us/step - loss: 0.3245 - val_loss: 0.3315\n",
      "\n",
      "Epoch 00335: val_loss did not improve from 0.33076\n",
      "Epoch 336/5000\n",
      "1257/1257 [==============================] - 0s 58us/step - loss: 0.3246 - val_loss: 0.3315\n",
      "\n",
      "Epoch 00336: val_loss did not improve from 0.33076\n",
      "Epoch 337/5000\n",
      "1257/1257 [==============================] - 0s 53us/step - loss: 0.3251 - val_loss: 0.3307\n",
      "\n",
      "Epoch 00337: val_loss improved from 0.33076 to 0.33072, saving model to autoencode_digit.hdf5\n",
      "Epoch 338/5000\n",
      "1257/1257 [==============================] - 0s 49us/step - loss: 0.3246 - val_loss: 0.3318\n",
      "\n",
      "Epoch 00338: val_loss did not improve from 0.33072\n",
      "Epoch 339/5000\n",
      "1257/1257 [==============================] - 0s 49us/step - loss: 0.3246 - val_loss: 0.3308\n",
      "\n",
      "Epoch 00339: val_loss did not improve from 0.33072\n",
      "Epoch 340/5000\n",
      "1257/1257 [==============================] - 0s 50us/step - loss: 0.3245 - val_loss: 0.3312\n",
      "\n",
      "Epoch 00340: val_loss did not improve from 0.33072\n",
      "Epoch 341/5000\n",
      "1257/1257 [==============================] - 0s 58us/step - loss: 0.3246 - val_loss: 0.3313\n",
      "\n",
      "Epoch 00341: val_loss did not improve from 0.33072\n",
      "Epoch 342/5000\n",
      "1257/1257 [==============================] - 0s 50us/step - loss: 0.3245 - val_loss: 0.3309\n",
      "\n",
      "Epoch 00342: val_loss did not improve from 0.33072\n",
      "Epoch 343/5000\n",
      "1257/1257 [==============================] - 0s 45us/step - loss: 0.3246 - val_loss: 0.3312\n",
      "\n",
      "Epoch 00343: val_loss did not improve from 0.33072\n",
      "Epoch 344/5000\n",
      "1257/1257 [==============================] - 0s 45us/step - loss: 0.3244 - val_loss: 0.3310\n",
      "\n",
      "Epoch 00344: val_loss did not improve from 0.33072\n",
      "Epoch 345/5000\n",
      "1257/1257 [==============================] - 0s 45us/step - loss: 0.3242 - val_loss: 0.3310\n",
      "\n",
      "Epoch 00345: val_loss did not improve from 0.33072\n",
      "Epoch 346/5000\n",
      "1257/1257 [==============================] - 0s 49us/step - loss: 0.3255 - val_loss: 0.3306\n",
      "\n",
      "Epoch 00346: val_loss improved from 0.33072 to 0.33057, saving model to autoencode_digit.hdf5\n",
      "Epoch 347/5000\n",
      "1257/1257 [==============================] - 0s 45us/step - loss: 0.3245 - val_loss: 0.3312\n",
      "\n",
      "Epoch 00347: val_loss did not improve from 0.33057\n",
      "Epoch 348/5000\n",
      "1257/1257 [==============================] - 0s 50us/step - loss: 0.3252 - val_loss: 0.3310\n",
      "\n",
      "Epoch 00348: val_loss did not improve from 0.33057\n",
      "Epoch 349/5000\n",
      "1257/1257 [==============================] - 0s 53us/step - loss: 0.3242 - val_loss: 0.3308\n",
      "\n",
      "Epoch 00349: val_loss did not improve from 0.33057\n",
      "Epoch 350/5000\n",
      "1257/1257 [==============================] - 0s 61us/step - loss: 0.3241 - val_loss: 0.3310\n",
      "\n",
      "Epoch 00350: val_loss did not improve from 0.33057\n",
      "Epoch 351/5000\n",
      "1257/1257 [==============================] - 0s 58us/step - loss: 0.3242 - val_loss: 0.3304\n",
      "\n",
      "Epoch 00351: val_loss improved from 0.33057 to 0.33045, saving model to autoencode_digit.hdf5\n",
      "Epoch 352/5000\n",
      "1257/1257 [==============================] - 0s 49us/step - loss: 0.3240 - val_loss: 0.3309\n",
      "\n",
      "Epoch 00352: val_loss did not improve from 0.33045\n",
      "Epoch 353/5000\n",
      "1257/1257 [==============================] - 0s 48us/step - loss: 0.3238 - val_loss: 0.3309\n",
      "\n",
      "Epoch 00353: val_loss did not improve from 0.33045\n",
      "Epoch 354/5000\n",
      "1257/1257 [==============================] - 0s 51us/step - loss: 0.3242 - val_loss: 0.3306\n",
      "\n",
      "Epoch 00354: val_loss did not improve from 0.33045\n",
      "Epoch 355/5000\n",
      "1257/1257 [==============================] - 0s 50us/step - loss: 0.3240 - val_loss: 0.3304\n",
      "\n",
      "Epoch 00355: val_loss improved from 0.33045 to 0.33043, saving model to autoencode_digit.hdf5\n",
      "Epoch 356/5000\n",
      "1257/1257 [==============================] - 0s 47us/step - loss: 0.3242 - val_loss: 0.3305\n",
      "\n",
      "Epoch 00356: val_loss did not improve from 0.33043\n",
      "Epoch 357/5000\n",
      "1257/1257 [==============================] - 0s 49us/step - loss: 0.3236 - val_loss: 0.3310\n",
      "\n",
      "Epoch 00357: val_loss did not improve from 0.33043\n",
      "Epoch 358/5000\n",
      "1257/1257 [==============================] - 0s 53us/step - loss: 0.3240 - val_loss: 0.3314\n",
      "\n",
      "Epoch 00358: val_loss did not improve from 0.33043\n",
      "Epoch 359/5000\n",
      "1257/1257 [==============================] - 0s 49us/step - loss: 0.3238 - val_loss: 0.3309\n",
      "\n",
      "Epoch 00359: val_loss did not improve from 0.33043\n",
      "Epoch 360/5000\n",
      "1257/1257 [==============================] - 0s 51us/step - loss: 0.3238 - val_loss: 0.3306\n",
      "\n",
      "Epoch 00360: val_loss did not improve from 0.33043\n",
      "Epoch 361/5000\n",
      "1257/1257 [==============================] - 0s 49us/step - loss: 0.3238 - val_loss: 0.3304\n",
      "\n",
      "Epoch 00361: val_loss did not improve from 0.33043\n",
      "Epoch 362/5000\n",
      "1257/1257 [==============================] - 0s 50us/step - loss: 0.3236 - val_loss: 0.3303\n",
      "\n",
      "Epoch 00362: val_loss improved from 0.33043 to 0.33027, saving model to autoencode_digit.hdf5\n",
      "Epoch 363/5000\n",
      "1257/1257 [==============================] - 0s 47us/step - loss: 0.3237 - val_loss: 0.3308\n",
      "\n",
      "Epoch 00363: val_loss did not improve from 0.33027\n",
      "Epoch 364/5000\n",
      "1257/1257 [==============================] - 0s 49us/step - loss: 0.3242 - val_loss: 0.3317\n",
      "\n",
      "Epoch 00364: val_loss did not improve from 0.33027\n",
      "Epoch 365/5000\n",
      "1257/1257 [==============================] - 0s 55us/step - loss: 0.3243 - val_loss: 0.3302\n",
      "\n",
      "Epoch 00365: val_loss improved from 0.33027 to 0.33021, saving model to autoencode_digit.hdf5\n",
      "Epoch 366/5000\n",
      "1257/1257 [==============================] - 0s 49us/step - loss: 0.3237 - val_loss: 0.3309\n",
      "\n",
      "Epoch 00366: val_loss did not improve from 0.33021\n",
      "Epoch 367/5000\n",
      "1257/1257 [==============================] - 0s 51us/step - loss: 0.3237 - val_loss: 0.3305\n",
      "\n",
      "Epoch 00367: val_loss did not improve from 0.33021\n",
      "Epoch 368/5000\n",
      "1257/1257 [==============================] - 0s 51us/step - loss: 0.3235 - val_loss: 0.3310\n",
      "\n",
      "Epoch 00368: val_loss did not improve from 0.33021\n",
      "Epoch 369/5000\n",
      "1257/1257 [==============================] - 0s 54us/step - loss: 0.3236 - val_loss: 0.3307\n",
      "\n",
      "Epoch 00369: val_loss did not improve from 0.33021\n",
      "Epoch 370/5000\n",
      "1257/1257 [==============================] - 0s 55us/step - loss: 0.3240 - val_loss: 0.3306\n",
      "\n",
      "Epoch 00370: val_loss did not improve from 0.33021\n",
      "Epoch 371/5000\n",
      "1257/1257 [==============================] - 0s 61us/step - loss: 0.3237 - val_loss: 0.3300\n",
      "\n",
      "Epoch 00371: val_loss improved from 0.33021 to 0.33001, saving model to autoencode_digit.hdf5\n",
      "Epoch 372/5000\n",
      "1257/1257 [==============================] - 0s 54us/step - loss: 0.3236 - val_loss: 0.3302\n",
      "\n",
      "Epoch 00372: val_loss did not improve from 0.33001\n",
      "Epoch 373/5000\n",
      "1257/1257 [==============================] - 0s 53us/step - loss: 0.3232 - val_loss: 0.3308\n",
      "\n",
      "Epoch 00373: val_loss did not improve from 0.33001\n",
      "Epoch 374/5000\n",
      "1257/1257 [==============================] - 0s 53us/step - loss: 0.3238 - val_loss: 0.3305\n",
      "\n",
      "Epoch 00374: val_loss did not improve from 0.33001\n",
      "Epoch 375/5000\n",
      "1257/1257 [==============================] - 0s 53us/step - loss: 0.3233 - val_loss: 0.3306\n",
      "\n",
      "Epoch 00375: val_loss did not improve from 0.33001\n",
      "Epoch 376/5000\n",
      "1257/1257 [==============================] - 0s 49us/step - loss: 0.3237 - val_loss: 0.3314\n",
      "\n",
      "Epoch 00376: val_loss did not improve from 0.33001\n",
      "Epoch 377/5000\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "1257/1257 [==============================] - 0s 53us/step - loss: 0.3234 - val_loss: 0.3308\n",
      "\n",
      "Epoch 00377: val_loss did not improve from 0.33001\n",
      "Epoch 378/5000\n",
      "1257/1257 [==============================] - 0s 53us/step - loss: 0.3235 - val_loss: 0.3317\n",
      "\n",
      "Epoch 00378: val_loss did not improve from 0.33001\n",
      "Epoch 379/5000\n",
      "1257/1257 [==============================] - 0s 44us/step - loss: 0.3237 - val_loss: 0.3315\n",
      "\n",
      "Epoch 00379: val_loss did not improve from 0.33001\n",
      "Epoch 380/5000\n",
      "1257/1257 [==============================] - 0s 50us/step - loss: 0.3235 - val_loss: 0.3314\n",
      "\n",
      "Epoch 00380: val_loss did not improve from 0.33001\n",
      "Epoch 381/5000\n",
      "1257/1257 [==============================] - 0s 50us/step - loss: 0.3234 - val_loss: 0.3311\n",
      "\n",
      "Epoch 00381: val_loss did not improve from 0.33001\n",
      "Epoch 382/5000\n",
      "1257/1257 [==============================] - 0s 46us/step - loss: 0.3235 - val_loss: 0.3302\n",
      "\n",
      "Epoch 00382: val_loss did not improve from 0.33001\n",
      "Epoch 383/5000\n",
      "1257/1257 [==============================] - 0s 44us/step - loss: 0.3232 - val_loss: 0.3310\n",
      "\n",
      "Epoch 00383: val_loss did not improve from 0.33001\n",
      "Epoch 384/5000\n",
      "1257/1257 [==============================] - 0s 45us/step - loss: 0.3229 - val_loss: 0.3306\n",
      "\n",
      "Epoch 00384: val_loss did not improve from 0.33001\n",
      "Epoch 385/5000\n",
      "1257/1257 [==============================] - 0s 57us/step - loss: 0.3228 - val_loss: 0.3299\n",
      "\n",
      "Epoch 00385: val_loss improved from 0.33001 to 0.32989, saving model to autoencode_digit.hdf5\n",
      "Epoch 386/5000\n",
      "1257/1257 [==============================] - 0s 55us/step - loss: 0.3227 - val_loss: 0.3309\n",
      "\n",
      "Epoch 00386: val_loss did not improve from 0.32989\n",
      "Epoch 387/5000\n",
      "1257/1257 [==============================] - 0s 49us/step - loss: 0.3230 - val_loss: 0.3300\n",
      "\n",
      "Epoch 00387: val_loss did not improve from 0.32989\n",
      "Epoch 388/5000\n",
      "1257/1257 [==============================] - 0s 49us/step - loss: 0.3229 - val_loss: 0.3305\n",
      "\n",
      "Epoch 00388: val_loss did not improve from 0.32989\n",
      "Epoch 389/5000\n",
      "1257/1257 [==============================] - 0s 48us/step - loss: 0.3229 - val_loss: 0.3301\n",
      "\n",
      "Epoch 00389: val_loss did not improve from 0.32989\n",
      "Epoch 390/5000\n",
      "1257/1257 [==============================] - 0s 44us/step - loss: 0.3235 - val_loss: 0.3310\n",
      "\n",
      "Epoch 00390: val_loss did not improve from 0.32989\n",
      "Epoch 391/5000\n",
      "1257/1257 [==============================] - 0s 45us/step - loss: 0.3231 - val_loss: 0.3310\n",
      "\n",
      "Epoch 00391: val_loss did not improve from 0.32989\n",
      "Epoch 392/5000\n",
      "1257/1257 [==============================] - 0s 49us/step - loss: 0.3225 - val_loss: 0.3296\n",
      "\n",
      "Epoch 00392: val_loss improved from 0.32989 to 0.32963, saving model to autoencode_digit.hdf5\n",
      "Epoch 393/5000\n",
      "1257/1257 [==============================] - 0s 52us/step - loss: 0.3222 - val_loss: 0.3301\n",
      "\n",
      "Epoch 00393: val_loss did not improve from 0.32963\n",
      "Epoch 394/5000\n",
      "1257/1257 [==============================] - 0s 54us/step - loss: 0.3224 - val_loss: 0.3296\n",
      "\n",
      "Epoch 00394: val_loss did not improve from 0.32963\n",
      "Epoch 395/5000\n",
      "1257/1257 [==============================] - 0s 48us/step - loss: 0.3221 - val_loss: 0.3302\n",
      "\n",
      "Epoch 00395: val_loss did not improve from 0.32963\n",
      "Epoch 396/5000\n",
      "1257/1257 [==============================] - 0s 50us/step - loss: 0.3223 - val_loss: 0.3296\n",
      "\n",
      "Epoch 00396: val_loss did not improve from 0.32963\n",
      "Epoch 397/5000\n",
      "1257/1257 [==============================] - 0s 51us/step - loss: 0.3219 - val_loss: 0.3301\n",
      "\n",
      "Epoch 00397: val_loss did not improve from 0.32963\n",
      "Epoch 398/5000\n",
      "1257/1257 [==============================] - 0s 56us/step - loss: 0.3222 - val_loss: 0.3297\n",
      "\n",
      "Epoch 00398: val_loss did not improve from 0.32963\n",
      "Epoch 399/5000\n",
      "1257/1257 [==============================] - 0s 60us/step - loss: 0.3220 - val_loss: 0.3298\n",
      "\n",
      "Epoch 00399: val_loss did not improve from 0.32963\n",
      "Epoch 400/5000\n",
      "1257/1257 [==============================] - 0s 57us/step - loss: 0.3223 - val_loss: 0.3295\n",
      "\n",
      "Epoch 00400: val_loss improved from 0.32963 to 0.32951, saving model to autoencode_digit.hdf5\n",
      "Epoch 401/5000\n",
      "1257/1257 [==============================] - 0s 47us/step - loss: 0.3217 - val_loss: 0.3291\n",
      "\n",
      "Epoch 00401: val_loss improved from 0.32951 to 0.32915, saving model to autoencode_digit.hdf5\n",
      "Epoch 402/5000\n",
      "1257/1257 [==============================] - 0s 56us/step - loss: 0.3217 - val_loss: 0.3308\n",
      "\n",
      "Epoch 00402: val_loss did not improve from 0.32915\n",
      "Epoch 403/5000\n",
      "1257/1257 [==============================] - 0s 56us/step - loss: 0.3217 - val_loss: 0.3299\n",
      "\n",
      "Epoch 00403: val_loss did not improve from 0.32915\n",
      "Epoch 404/5000\n",
      "1257/1257 [==============================] - 0s 69us/step - loss: 0.3219 - val_loss: 0.3300\n",
      "\n",
      "Epoch 00404: val_loss did not improve from 0.32915\n",
      "Epoch 405/5000\n",
      "1257/1257 [==============================] - 0s 72us/step - loss: 0.3214 - val_loss: 0.3300\n",
      "\n",
      "Epoch 00405: val_loss did not improve from 0.32915\n",
      "Epoch 406/5000\n",
      "1257/1257 [==============================] - 0s 56us/step - loss: 0.3216 - val_loss: 0.3290\n",
      "\n",
      "Epoch 00406: val_loss improved from 0.32915 to 0.32903, saving model to autoencode_digit.hdf5\n",
      "Epoch 407/5000\n",
      "1257/1257 [==============================] - 0s 54us/step - loss: 0.3213 - val_loss: 0.3289\n",
      "\n",
      "Epoch 00407: val_loss improved from 0.32903 to 0.32889, saving model to autoencode_digit.hdf5\n",
      "Epoch 408/5000\n",
      "1257/1257 [==============================] - 0s 53us/step - loss: 0.3215 - val_loss: 0.3301\n",
      "\n",
      "Epoch 00408: val_loss did not improve from 0.32889\n",
      "Epoch 409/5000\n",
      "1257/1257 [==============================] - 0s 52us/step - loss: 0.3216 - val_loss: 0.3296\n",
      "\n",
      "Epoch 00409: val_loss did not improve from 0.32889\n",
      "Epoch 410/5000\n",
      "1257/1257 [==============================] - 0s 56us/step - loss: 0.3214 - val_loss: 0.3294\n",
      "\n",
      "Epoch 00410: val_loss did not improve from 0.32889\n",
      "Epoch 411/5000\n",
      "1257/1257 [==============================] - 0s 55us/step - loss: 0.3214 - val_loss: 0.3294\n",
      "\n",
      "Epoch 00411: val_loss did not improve from 0.32889\n",
      "Epoch 412/5000\n",
      "1257/1257 [==============================] - 0s 52us/step - loss: 0.3210 - val_loss: 0.3295\n",
      "\n",
      "Epoch 00412: val_loss did not improve from 0.32889\n",
      "Epoch 413/5000\n",
      "1257/1257 [==============================] - 0s 53us/step - loss: 0.3211 - val_loss: 0.3301\n",
      "\n",
      "Epoch 00413: val_loss did not improve from 0.32889\n",
      "Epoch 414/5000\n",
      "1257/1257 [==============================] - 0s 56us/step - loss: 0.3209 - val_loss: 0.3289\n",
      "\n",
      "Epoch 00414: val_loss did not improve from 0.32889\n",
      "Epoch 415/5000\n",
      "1257/1257 [==============================] - 0s 69us/step - loss: 0.3213 - val_loss: 0.3305\n",
      "\n",
      "Epoch 00415: val_loss did not improve from 0.32889\n",
      "Epoch 416/5000\n",
      "1257/1257 [==============================] - 0s 59us/step - loss: 0.3211 - val_loss: 0.3295\n",
      "\n",
      "Epoch 00416: val_loss did not improve from 0.32889\n",
      "Epoch 417/5000\n",
      "1257/1257 [==============================] - 0s 58us/step - loss: 0.3208 - val_loss: 0.3299\n",
      "\n",
      "Epoch 00417: val_loss did not improve from 0.32889\n",
      "Epoch 418/5000\n",
      "1257/1257 [==============================] - 0s 63us/step - loss: 0.3208 - val_loss: 0.3288\n",
      "\n",
      "Epoch 00418: val_loss improved from 0.32889 to 0.32883, saving model to autoencode_digit.hdf5\n",
      "Epoch 419/5000\n",
      "1257/1257 [==============================] - 0s 58us/step - loss: 0.3210 - val_loss: 0.3297\n",
      "\n",
      "Epoch 00419: val_loss did not improve from 0.32883\n",
      "Epoch 420/5000\n",
      "1257/1257 [==============================] - 0s 65us/step - loss: 0.3210 - val_loss: 0.3292\n",
      "\n",
      "Epoch 00420: val_loss did not improve from 0.32883\n",
      "Epoch 421/5000\n",
      "1257/1257 [==============================] - 0s 69us/step - loss: 0.3211 - val_loss: 0.3290\n",
      "\n",
      "Epoch 00421: val_loss did not improve from 0.32883\n",
      "Epoch 422/5000\n",
      "1257/1257 [==============================] - 0s 71us/step - loss: 0.3211 - val_loss: 0.3285\n",
      "\n",
      "Epoch 00422: val_loss improved from 0.32883 to 0.32852, saving model to autoencode_digit.hdf5\n",
      "Epoch 423/5000\n",
      "1257/1257 [==============================] - 0s 58us/step - loss: 0.3210 - val_loss: 0.3286\n",
      "\n",
      "Epoch 00423: val_loss did not improve from 0.32852\n",
      "Epoch 424/5000\n",
      "1257/1257 [==============================] - 0s 55us/step - loss: 0.3206 - val_loss: 0.3281\n",
      "\n",
      "Epoch 00424: val_loss improved from 0.32852 to 0.32813, saving model to autoencode_digit.hdf5\n",
      "Epoch 425/5000\n",
      "1257/1257 [==============================] - 0s 61us/step - loss: 0.3208 - val_loss: 0.3291\n",
      "\n",
      "Epoch 00425: val_loss did not improve from 0.32813\n",
      "Epoch 426/5000\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "1257/1257 [==============================] - 0s 64us/step - loss: 0.3208 - val_loss: 0.3290\n",
      "\n",
      "Epoch 00426: val_loss did not improve from 0.32813\n",
      "Epoch 427/5000\n",
      "1257/1257 [==============================] - 0s 57us/step - loss: 0.3209 - val_loss: 0.3286\n",
      "\n",
      "Epoch 00427: val_loss did not improve from 0.32813\n",
      "Epoch 428/5000\n",
      "1257/1257 [==============================] - 0s 61us/step - loss: 0.3202 - val_loss: 0.3285\n",
      "\n",
      "Epoch 00428: val_loss did not improve from 0.32813\n",
      "Epoch 429/5000\n",
      "1257/1257 [==============================] - 0s 62us/step - loss: 0.3203 - val_loss: 0.3292\n",
      "\n",
      "Epoch 00429: val_loss did not improve from 0.32813\n",
      "Epoch 430/5000\n",
      "1257/1257 [==============================] - 0s 62us/step - loss: 0.3202 - val_loss: 0.3280\n",
      "\n",
      "Epoch 00430: val_loss improved from 0.32813 to 0.32797, saving model to autoencode_digit.hdf5\n",
      "Epoch 431/5000\n",
      "1257/1257 [==============================] - 0s 57us/step - loss: 0.3204 - val_loss: 0.3285\n",
      "\n",
      "Epoch 00431: val_loss did not improve from 0.32797\n",
      "Epoch 432/5000\n",
      "1257/1257 [==============================] - 0s 53us/step - loss: 0.3200 - val_loss: 0.3284\n",
      "\n",
      "Epoch 00432: val_loss did not improve from 0.32797\n",
      "Epoch 433/5000\n",
      "1257/1257 [==============================] - 0s 61us/step - loss: 0.3207 - val_loss: 0.3284\n",
      "\n",
      "Epoch 00433: val_loss did not improve from 0.32797\n",
      "Epoch 434/5000\n",
      "1257/1257 [==============================] - 0s 51us/step - loss: 0.3203 - val_loss: 0.3280\n",
      "\n",
      "Epoch 00434: val_loss did not improve from 0.32797\n",
      "Epoch 435/5000\n",
      "1257/1257 [==============================] - 0s 57us/step - loss: 0.3203 - val_loss: 0.3294\n",
      "\n",
      "Epoch 00435: val_loss did not improve from 0.32797\n",
      "Epoch 436/5000\n",
      "1257/1257 [==============================] - 0s 52us/step - loss: 0.3202 - val_loss: 0.3286\n",
      "\n",
      "Epoch 00436: val_loss did not improve from 0.32797\n",
      "Epoch 437/5000\n",
      "1257/1257 [==============================] - 0s 53us/step - loss: 0.3205 - val_loss: 0.3294\n",
      "\n",
      "Epoch 00437: val_loss did not improve from 0.32797\n",
      "Epoch 438/5000\n",
      "1257/1257 [==============================] - 0s 55us/step - loss: 0.3207 - val_loss: 0.3291\n",
      "\n",
      "Epoch 00438: val_loss did not improve from 0.32797\n",
      "Epoch 439/5000\n",
      "1257/1257 [==============================] - 0s 54us/step - loss: 0.3198 - val_loss: 0.3284\n",
      "\n",
      "Epoch 00439: val_loss did not improve from 0.32797\n",
      "Epoch 440/5000\n",
      "1257/1257 [==============================] - 0s 59us/step - loss: 0.3198 - val_loss: 0.3276\n",
      "\n",
      "Epoch 00440: val_loss improved from 0.32797 to 0.32759, saving model to autoencode_digit.hdf5\n",
      "Epoch 441/5000\n",
      "1257/1257 [==============================] - 0s 57us/step - loss: 0.3202 - val_loss: 0.3288\n",
      "\n",
      "Epoch 00441: val_loss did not improve from 0.32759\n",
      "Epoch 442/5000\n",
      "1257/1257 [==============================] - 0s 51us/step - loss: 0.3201 - val_loss: 0.3280\n",
      "\n",
      "Epoch 00442: val_loss did not improve from 0.32759\n",
      "Epoch 443/5000\n",
      "1257/1257 [==============================] - 0s 45us/step - loss: 0.3196 - val_loss: 0.3282\n",
      "\n",
      "Epoch 00443: val_loss did not improve from 0.32759\n",
      "Epoch 444/5000\n",
      "1257/1257 [==============================] - 0s 49us/step - loss: 0.3195 - val_loss: 0.3286\n",
      "\n",
      "Epoch 00444: val_loss did not improve from 0.32759\n",
      "Epoch 445/5000\n",
      "1257/1257 [==============================] - 0s 54us/step - loss: 0.3205 - val_loss: 0.3280\n",
      "\n",
      "Epoch 00445: val_loss did not improve from 0.32759\n",
      "Epoch 446/5000\n",
      "1257/1257 [==============================] - 0s 56us/step - loss: 0.3200 - val_loss: 0.3292\n",
      "\n",
      "Epoch 00446: val_loss did not improve from 0.32759\n",
      "Epoch 447/5000\n",
      "1257/1257 [==============================] - 0s 54us/step - loss: 0.3198 - val_loss: 0.3279\n",
      "\n",
      "Epoch 00447: val_loss did not improve from 0.32759\n",
      "Epoch 448/5000\n",
      "1257/1257 [==============================] - 0s 53us/step - loss: 0.3191 - val_loss: 0.3278\n",
      "\n",
      "Epoch 00448: val_loss did not improve from 0.32759\n",
      "Epoch 449/5000\n",
      "1257/1257 [==============================] - 0s 48us/step - loss: 0.3195 - val_loss: 0.3277\n",
      "\n",
      "Epoch 00449: val_loss did not improve from 0.32759\n",
      "Epoch 450/5000\n",
      "1257/1257 [==============================] - 0s 47us/step - loss: 0.3194 - val_loss: 0.3280\n",
      "\n",
      "Epoch 00450: val_loss did not improve from 0.32759\n",
      "Epoch 451/5000\n",
      "1257/1257 [==============================] - 0s 49us/step - loss: 0.3190 - val_loss: 0.3284\n",
      "\n",
      "Epoch 00451: val_loss did not improve from 0.32759\n",
      "Epoch 452/5000\n",
      "1257/1257 [==============================] - 0s 53us/step - loss: 0.3190 - val_loss: 0.3280\n",
      "\n",
      "Epoch 00452: val_loss did not improve from 0.32759\n",
      "Epoch 453/5000\n",
      "1257/1257 [==============================] - 0s 51us/step - loss: 0.3194 - val_loss: 0.3278\n",
      "\n",
      "Epoch 00453: val_loss did not improve from 0.32759\n",
      "Epoch 454/5000\n",
      "1257/1257 [==============================] - 0s 50us/step - loss: 0.3195 - val_loss: 0.3279\n",
      "\n",
      "Epoch 00454: val_loss did not improve from 0.32759\n",
      "Epoch 455/5000\n",
      "1257/1257 [==============================] - 0s 50us/step - loss: 0.3193 - val_loss: 0.3274\n",
      "\n",
      "Epoch 00455: val_loss improved from 0.32759 to 0.32744, saving model to autoencode_digit.hdf5\n",
      "Epoch 456/5000\n",
      "1257/1257 [==============================] - 0s 45us/step - loss: 0.3189 - val_loss: 0.3268\n",
      "\n",
      "Epoch 00456: val_loss improved from 0.32744 to 0.32681, saving model to autoencode_digit.hdf5\n",
      "Epoch 457/5000\n",
      "1257/1257 [==============================] - 0s 44us/step - loss: 0.3197 - val_loss: 0.3278\n",
      "\n",
      "Epoch 00457: val_loss did not improve from 0.32681\n",
      "Epoch 458/5000\n",
      "1257/1257 [==============================] - 0s 49us/step - loss: 0.3191 - val_loss: 0.3269\n",
      "\n",
      "Epoch 00458: val_loss did not improve from 0.32681\n",
      "Epoch 459/5000\n",
      "1257/1257 [==============================] - 0s 49us/step - loss: 0.3193 - val_loss: 0.3273\n",
      "\n",
      "Epoch 00459: val_loss did not improve from 0.32681\n",
      "Epoch 460/5000\n",
      "1257/1257 [==============================] - 0s 45us/step - loss: 0.3192 - val_loss: 0.3274\n",
      "\n",
      "Epoch 00460: val_loss did not improve from 0.32681\n",
      "Epoch 461/5000\n",
      "1257/1257 [==============================] - 0s 48us/step - loss: 0.3190 - val_loss: 0.3286\n",
      "\n",
      "Epoch 00461: val_loss did not improve from 0.32681\n",
      "Epoch 462/5000\n",
      "1257/1257 [==============================] - 0s 50us/step - loss: 0.3193 - val_loss: 0.3273\n",
      "\n",
      "Epoch 00462: val_loss did not improve from 0.32681\n",
      "Epoch 463/5000\n",
      "1257/1257 [==============================] - 0s 52us/step - loss: 0.3191 - val_loss: 0.3274\n",
      "\n",
      "Epoch 00463: val_loss did not improve from 0.32681\n",
      "Epoch 464/5000\n",
      "1257/1257 [==============================] - 0s 50us/step - loss: 0.3191 - val_loss: 0.3271\n",
      "\n",
      "Epoch 00464: val_loss did not improve from 0.32681\n",
      "Epoch 465/5000\n",
      "1257/1257 [==============================] - 0s 45us/step - loss: 0.3188 - val_loss: 0.3276\n",
      "\n",
      "Epoch 00465: val_loss did not improve from 0.32681\n",
      "Epoch 466/5000\n",
      "1257/1257 [==============================] - 0s 45us/step - loss: 0.3188 - val_loss: 0.3281\n",
      "\n",
      "Epoch 00466: val_loss did not improve from 0.32681\n",
      "Epoch 467/5000\n",
      "1257/1257 [==============================] - 0s 46us/step - loss: 0.3187 - val_loss: 0.3275\n",
      "\n",
      "Epoch 00467: val_loss did not improve from 0.32681\n",
      "Epoch 468/5000\n",
      "1257/1257 [==============================] - 0s 45us/step - loss: 0.3187 - val_loss: 0.3274\n",
      "\n",
      "Epoch 00468: val_loss did not improve from 0.32681\n",
      "Epoch 469/5000\n",
      "1257/1257 [==============================] - 0s 45us/step - loss: 0.3188 - val_loss: 0.3279\n",
      "\n",
      "Epoch 00469: val_loss did not improve from 0.32681\n",
      "Epoch 470/5000\n",
      "1257/1257 [==============================] - 0s 45us/step - loss: 0.3190 - val_loss: 0.3266\n",
      "\n",
      "Epoch 00470: val_loss improved from 0.32681 to 0.32662, saving model to autoencode_digit.hdf5\n",
      "Epoch 471/5000\n",
      "1257/1257 [==============================] - 0s 48us/step - loss: 0.3192 - val_loss: 0.3271\n",
      "\n",
      "Epoch 00471: val_loss did not improve from 0.32662\n",
      "Epoch 472/5000\n",
      "1257/1257 [==============================] - 0s 49us/step - loss: 0.3186 - val_loss: 0.3271\n",
      "\n",
      "Epoch 00472: val_loss did not improve from 0.32662\n",
      "Epoch 473/5000\n",
      "1257/1257 [==============================] - 0s 49us/step - loss: 0.3185 - val_loss: 0.3281\n",
      "\n",
      "Epoch 00473: val_loss did not improve from 0.32662\n",
      "Epoch 474/5000\n",
      "1257/1257 [==============================] - 0s 51us/step - loss: 0.3187 - val_loss: 0.3263\n",
      "\n",
      "Epoch 00474: val_loss improved from 0.32662 to 0.32628, saving model to autoencode_digit.hdf5\n",
      "Epoch 475/5000\n",
      "1257/1257 [==============================] - 0s 51us/step - loss: 0.3182 - val_loss: 0.3265\n",
      "\n",
      "Epoch 00475: val_loss did not improve from 0.32628\n",
      "Epoch 476/5000\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "1257/1257 [==============================] - 0s 46us/step - loss: 0.3186 - val_loss: 0.3276\n",
      "\n",
      "Epoch 00476: val_loss did not improve from 0.32628\n",
      "Epoch 477/5000\n",
      "1257/1257 [==============================] - 0s 53us/step - loss: 0.3180 - val_loss: 0.3272\n",
      "\n",
      "Epoch 00477: val_loss did not improve from 0.32628\n",
      "Epoch 478/5000\n",
      "1257/1257 [==============================] - 0s 46us/step - loss: 0.3179 - val_loss: 0.3277\n",
      "\n",
      "Epoch 00478: val_loss did not improve from 0.32628\n",
      "Epoch 479/5000\n",
      "1257/1257 [==============================] - 0s 45us/step - loss: 0.3183 - val_loss: 0.3275\n",
      "\n",
      "Epoch 00479: val_loss did not improve from 0.32628\n",
      "Epoch 480/5000\n",
      "1257/1257 [==============================] - 0s 44us/step - loss: 0.3183 - val_loss: 0.3269\n",
      "\n",
      "Epoch 00480: val_loss did not improve from 0.32628\n",
      "Epoch 481/5000\n",
      "1257/1257 [==============================] - 0s 48us/step - loss: 0.3178 - val_loss: 0.3272\n",
      "\n",
      "Epoch 00481: val_loss did not improve from 0.32628\n",
      "Epoch 482/5000\n",
      "1257/1257 [==============================] - 0s 45us/step - loss: 0.3182 - val_loss: 0.3273\n",
      "\n",
      "Epoch 00482: val_loss did not improve from 0.32628\n",
      "Epoch 483/5000\n",
      "1257/1257 [==============================] - 0s 49us/step - loss: 0.3185 - val_loss: 0.3275\n",
      "\n",
      "Epoch 00483: val_loss did not improve from 0.32628\n",
      "Epoch 484/5000\n",
      "1257/1257 [==============================] - 0s 50us/step - loss: 0.3178 - val_loss: 0.3262\n",
      "\n",
      "Epoch 00484: val_loss improved from 0.32628 to 0.32624, saving model to autoencode_digit.hdf5\n",
      "Epoch 485/5000\n",
      "1257/1257 [==============================] - 0s 43us/step - loss: 0.3177 - val_loss: 0.3271\n",
      "\n",
      "Epoch 00485: val_loss did not improve from 0.32624\n",
      "Epoch 486/5000\n",
      "1257/1257 [==============================] - 0s 45us/step - loss: 0.3183 - val_loss: 0.3267\n",
      "\n",
      "Epoch 00486: val_loss did not improve from 0.32624\n",
      "Epoch 487/5000\n",
      "1257/1257 [==============================] - 0s 50us/step - loss: 0.3180 - val_loss: 0.3262\n",
      "\n",
      "Epoch 00487: val_loss improved from 0.32624 to 0.32618, saving model to autoencode_digit.hdf5\n",
      "Epoch 488/5000\n",
      "1257/1257 [==============================] - 0s 43us/step - loss: 0.3176 - val_loss: 0.3262\n",
      "\n",
      "Epoch 00488: val_loss did not improve from 0.32618\n",
      "Epoch 489/5000\n",
      "1257/1257 [==============================] - 0s 48us/step - loss: 0.3177 - val_loss: 0.3266\n",
      "\n",
      "Epoch 00489: val_loss did not improve from 0.32618\n",
      "Epoch 490/5000\n",
      "1257/1257 [==============================] - 0s 43us/step - loss: 0.3181 - val_loss: 0.3266\n",
      "\n",
      "Epoch 00490: val_loss did not improve from 0.32618\n",
      "Epoch 491/5000\n",
      "1257/1257 [==============================] - 0s 45us/step - loss: 0.3179 - val_loss: 0.3263\n",
      "\n",
      "Epoch 00491: val_loss did not improve from 0.32618\n",
      "Epoch 492/5000\n",
      "1257/1257 [==============================] - 0s 50us/step - loss: 0.3179 - val_loss: 0.3272\n",
      "\n",
      "Epoch 00492: val_loss did not improve from 0.32618\n",
      "Epoch 493/5000\n",
      "1257/1257 [==============================] - 0s 45us/step - loss: 0.3184 - val_loss: 0.3269\n",
      "\n",
      "Epoch 00493: val_loss did not improve from 0.32618\n",
      "Epoch 494/5000\n",
      "1257/1257 [==============================] - 0s 47us/step - loss: 0.3179 - val_loss: 0.3267\n",
      "\n",
      "Epoch 00494: val_loss did not improve from 0.32618\n",
      "Epoch 495/5000\n",
      "1257/1257 [==============================] - 0s 45us/step - loss: 0.3175 - val_loss: 0.3260\n",
      "\n",
      "Epoch 00495: val_loss improved from 0.32618 to 0.32605, saving model to autoencode_digit.hdf5\n",
      "Epoch 496/5000\n",
      "1257/1257 [==============================] - 0s 44us/step - loss: 0.3176 - val_loss: 0.3257\n",
      "\n",
      "Epoch 00496: val_loss improved from 0.32605 to 0.32573, saving model to autoencode_digit.hdf5\n",
      "Epoch 497/5000\n",
      "1257/1257 [==============================] - 0s 44us/step - loss: 0.3176 - val_loss: 0.3261\n",
      "\n",
      "Epoch 00497: val_loss did not improve from 0.32573\n",
      "Epoch 498/5000\n",
      "1257/1257 [==============================] - 0s 45us/step - loss: 0.3176 - val_loss: 0.3271\n",
      "\n",
      "Epoch 00498: val_loss did not improve from 0.32573\n",
      "Epoch 499/5000\n",
      "1257/1257 [==============================] - 0s 50us/step - loss: 0.3175 - val_loss: 0.3257\n",
      "\n",
      "Epoch 00499: val_loss improved from 0.32573 to 0.32565, saving model to autoencode_digit.hdf5\n",
      "Epoch 500/5000\n",
      "1257/1257 [==============================] - 0s 44us/step - loss: 0.3176 - val_loss: 0.3262\n",
      "\n",
      "Epoch 00500: val_loss did not improve from 0.32565\n",
      "Epoch 501/5000\n",
      "1257/1257 [==============================] - 0s 46us/step - loss: 0.3171 - val_loss: 0.3260\n",
      "\n",
      "Epoch 00501: val_loss did not improve from 0.32565\n",
      "Epoch 502/5000\n",
      "1257/1257 [==============================] - 0s 44us/step - loss: 0.3172 - val_loss: 0.3255\n",
      "\n",
      "Epoch 00502: val_loss improved from 0.32565 to 0.32554, saving model to autoencode_digit.hdf5\n",
      "Epoch 503/5000\n",
      "1257/1257 [==============================] - 0s 44us/step - loss: 0.3173 - val_loss: 0.3265\n",
      "\n",
      "Epoch 00503: val_loss did not improve from 0.32554\n",
      "Epoch 504/5000\n",
      "1257/1257 [==============================] - 0s 50us/step - loss: 0.3172 - val_loss: 0.3267\n",
      "\n",
      "Epoch 00504: val_loss did not improve from 0.32554\n",
      "Epoch 505/5000\n",
      "1257/1257 [==============================] - 0s 49us/step - loss: 0.3171 - val_loss: 0.3267\n",
      "\n",
      "Epoch 00505: val_loss did not improve from 0.32554\n",
      "Epoch 506/5000\n",
      "1257/1257 [==============================] - 0s 51us/step - loss: 0.3176 - val_loss: 0.3270\n",
      "\n",
      "Epoch 00506: val_loss did not improve from 0.32554\n",
      "Epoch 507/5000\n",
      "1257/1257 [==============================] - 0s 46us/step - loss: 0.3172 - val_loss: 0.3255\n",
      "\n",
      "Epoch 00507: val_loss improved from 0.32554 to 0.32553, saving model to autoencode_digit.hdf5\n",
      "Epoch 508/5000\n",
      "1257/1257 [==============================] - 0s 44us/step - loss: 0.3173 - val_loss: 0.3260\n",
      "\n",
      "Epoch 00508: val_loss did not improve from 0.32553\n",
      "Epoch 509/5000\n",
      "1257/1257 [==============================] - 0s 44us/step - loss: 0.3173 - val_loss: 0.3259\n",
      "\n",
      "Epoch 00509: val_loss did not improve from 0.32553\n",
      "Epoch 510/5000\n",
      "1257/1257 [==============================] - 0s 44us/step - loss: 0.3171 - val_loss: 0.3277\n",
      "\n",
      "Epoch 00510: val_loss did not improve from 0.32553\n",
      "Epoch 511/5000\n",
      "1257/1257 [==============================] - 0s 48us/step - loss: 0.3171 - val_loss: 0.3256\n",
      "\n",
      "Epoch 00511: val_loss did not improve from 0.32553\n",
      "Epoch 512/5000\n",
      "1257/1257 [==============================] - 0s 44us/step - loss: 0.3168 - val_loss: 0.3259\n",
      "\n",
      "Epoch 00512: val_loss did not improve from 0.32553\n",
      "Epoch 513/5000\n",
      "1257/1257 [==============================] - 0s 49us/step - loss: 0.3176 - val_loss: 0.3266\n",
      "\n",
      "Epoch 00513: val_loss did not improve from 0.32553\n",
      "Epoch 514/5000\n",
      "1257/1257 [==============================] - 0s 53us/step - loss: 0.3171 - val_loss: 0.3259\n",
      "\n",
      "Epoch 00514: val_loss did not improve from 0.32553\n",
      "Epoch 515/5000\n",
      "1257/1257 [==============================] - 0s 50us/step - loss: 0.3171 - val_loss: 0.3252\n",
      "\n",
      "Epoch 00515: val_loss improved from 0.32553 to 0.32524, saving model to autoencode_digit.hdf5\n",
      "Epoch 516/5000\n",
      "1257/1257 [==============================] - 0s 48us/step - loss: 0.3168 - val_loss: 0.3254\n",
      "\n",
      "Epoch 00516: val_loss did not improve from 0.32524\n",
      "Epoch 517/5000\n",
      "1257/1257 [==============================] - 0s 49us/step - loss: 0.3164 - val_loss: 0.3258\n",
      "\n",
      "Epoch 00517: val_loss did not improve from 0.32524\n",
      "Epoch 518/5000\n",
      "1257/1257 [==============================] - 0s 51us/step - loss: 0.3165 - val_loss: 0.3258\n",
      "\n",
      "Epoch 00518: val_loss did not improve from 0.32524\n",
      "Epoch 519/5000\n",
      "1257/1257 [==============================] - 0s 44us/step - loss: 0.3171 - val_loss: 0.3265\n",
      "\n",
      "Epoch 00519: val_loss did not improve from 0.32524\n",
      "Epoch 520/5000\n",
      "1257/1257 [==============================] - 0s 53us/step - loss: 0.3171 - val_loss: 0.3262\n",
      "\n",
      "Epoch 00520: val_loss did not improve from 0.32524\n",
      "Epoch 521/5000\n",
      "1257/1257 [==============================] - 0s 55us/step - loss: 0.3174 - val_loss: 0.3268\n",
      "\n",
      "Epoch 00521: val_loss did not improve from 0.32524\n",
      "Epoch 522/5000\n",
      "1257/1257 [==============================] - 0s 45us/step - loss: 0.3170 - val_loss: 0.3262\n",
      "\n",
      "Epoch 00522: val_loss did not improve from 0.32524\n",
      "Epoch 523/5000\n",
      "1257/1257 [==============================] - 0s 50us/step - loss: 0.3167 - val_loss: 0.3258\n",
      "\n",
      "Epoch 00523: val_loss did not improve from 0.32524\n",
      "Epoch 524/5000\n",
      "1257/1257 [==============================] - 0s 49us/step - loss: 0.3164 - val_loss: 0.3257\n",
      "\n",
      "Epoch 00524: val_loss did not improve from 0.32524\n",
      "Epoch 525/5000\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "1257/1257 [==============================] - 0s 45us/step - loss: 0.3164 - val_loss: 0.3263\n",
      "\n",
      "Epoch 00525: val_loss did not improve from 0.32524\n",
      "Epoch 526/5000\n",
      "1257/1257 [==============================] - 0s 49us/step - loss: 0.3167 - val_loss: 0.3257\n",
      "\n",
      "Epoch 00526: val_loss did not improve from 0.32524\n",
      "Epoch 527/5000\n",
      "1257/1257 [==============================] - 0s 46us/step - loss: 0.3164 - val_loss: 0.3255\n",
      "\n",
      "Epoch 00527: val_loss did not improve from 0.32524\n",
      "Epoch 528/5000\n",
      "1257/1257 [==============================] - 0s 45us/step - loss: 0.3164 - val_loss: 0.3265\n",
      "\n",
      "Epoch 00528: val_loss did not improve from 0.32524\n",
      "Epoch 529/5000\n",
      "1257/1257 [==============================] - 0s 48us/step - loss: 0.3165 - val_loss: 0.3252\n",
      "\n",
      "Epoch 00529: val_loss improved from 0.32524 to 0.32519, saving model to autoencode_digit.hdf5\n",
      "Epoch 530/5000\n",
      "1257/1257 [==============================] - 0s 44us/step - loss: 0.3169 - val_loss: 0.3255\n",
      "\n",
      "Epoch 00530: val_loss did not improve from 0.32519\n",
      "Epoch 531/5000\n",
      "1257/1257 [==============================] - 0s 44us/step - loss: 0.3166 - val_loss: 0.3253\n",
      "\n",
      "Epoch 00531: val_loss did not improve from 0.32519\n",
      "Epoch 532/5000\n",
      "1257/1257 [==============================] - 0s 47us/step - loss: 0.3161 - val_loss: 0.3251\n",
      "\n",
      "Epoch 00532: val_loss improved from 0.32519 to 0.32507, saving model to autoencode_digit.hdf5\n",
      "Epoch 533/5000\n",
      "1257/1257 [==============================] - 0s 55us/step - loss: 0.3165 - val_loss: 0.3269\n",
      "\n",
      "Epoch 00533: val_loss did not improve from 0.32507\n",
      "Epoch 534/5000\n",
      "1257/1257 [==============================] - 0s 49us/step - loss: 0.3164 - val_loss: 0.3258\n",
      "\n",
      "Epoch 00534: val_loss did not improve from 0.32507\n",
      "Epoch 535/5000\n",
      "1257/1257 [==============================] - 0s 44us/step - loss: 0.3163 - val_loss: 0.3253\n",
      "\n",
      "Epoch 00535: val_loss did not improve from 0.32507\n",
      "Epoch 536/5000\n",
      "1257/1257 [==============================] - 0s 49us/step - loss: 0.3160 - val_loss: 0.3244\n",
      "\n",
      "Epoch 00536: val_loss improved from 0.32507 to 0.32437, saving model to autoencode_digit.hdf5\n",
      "Epoch 537/5000\n",
      "1257/1257 [==============================] - 0s 49us/step - loss: 0.3162 - val_loss: 0.3258\n",
      "\n",
      "Epoch 00537: val_loss did not improve from 0.32437\n",
      "Epoch 538/5000\n",
      "1257/1257 [==============================] - 0s 45us/step - loss: 0.3162 - val_loss: 0.3259\n",
      "\n",
      "Epoch 00538: val_loss did not improve from 0.32437\n",
      "Epoch 539/5000\n",
      "1257/1257 [==============================] - 0s 49us/step - loss: 0.3162 - val_loss: 0.3253\n",
      "\n",
      "Epoch 00539: val_loss did not improve from 0.32437\n",
      "Epoch 540/5000\n",
      "1257/1257 [==============================] - 0s 45us/step - loss: 0.3159 - val_loss: 0.3255\n",
      "\n",
      "Epoch 00540: val_loss did not improve from 0.32437\n",
      "Epoch 541/5000\n",
      "1257/1257 [==============================] - 0s 45us/step - loss: 0.3162 - val_loss: 0.3252\n",
      "\n",
      "Epoch 00541: val_loss did not improve from 0.32437\n",
      "Epoch 542/5000\n",
      "1257/1257 [==============================] - 0s 50us/step - loss: 0.3160 - val_loss: 0.3248\n",
      "\n",
      "Epoch 00542: val_loss did not improve from 0.32437\n",
      "Epoch 543/5000\n",
      "1257/1257 [==============================] - 0s 44us/step - loss: 0.3159 - val_loss: 0.3256\n",
      "\n",
      "Epoch 00543: val_loss did not improve from 0.32437\n",
      "Epoch 544/5000\n",
      "1257/1257 [==============================] - 0s 52us/step - loss: 0.3161 - val_loss: 0.3258\n",
      "\n",
      "Epoch 00544: val_loss did not improve from 0.32437\n",
      "Epoch 545/5000\n",
      "1257/1257 [==============================] - 0s 53us/step - loss: 0.3159 - val_loss: 0.3249\n",
      "\n",
      "Epoch 00545: val_loss did not improve from 0.32437\n",
      "Epoch 546/5000\n",
      "1257/1257 [==============================] - 0s 52us/step - loss: 0.3156 - val_loss: 0.3263\n",
      "\n",
      "Epoch 00546: val_loss did not improve from 0.32437\n",
      "Epoch 547/5000\n",
      "1257/1257 [==============================] - 0s 51us/step - loss: 0.3162 - val_loss: 0.3249\n",
      "\n",
      "Epoch 00547: val_loss did not improve from 0.32437\n",
      "Epoch 548/5000\n",
      "1257/1257 [==============================] - 0s 53us/step - loss: 0.3157 - val_loss: 0.3248\n",
      "\n",
      "Epoch 00548: val_loss did not improve from 0.32437\n",
      "Epoch 549/5000\n",
      "1257/1257 [==============================] - 0s 51us/step - loss: 0.3158 - val_loss: 0.3251\n",
      "\n",
      "Epoch 00549: val_loss did not improve from 0.32437\n",
      "Epoch 550/5000\n",
      "1257/1257 [==============================] - 0s 53us/step - loss: 0.3157 - val_loss: 0.3262\n",
      "\n",
      "Epoch 00550: val_loss did not improve from 0.32437\n",
      "Epoch 551/5000\n",
      "1257/1257 [==============================] - 0s 53us/step - loss: 0.3154 - val_loss: 0.3249\n",
      "\n",
      "Epoch 00551: val_loss did not improve from 0.32437\n",
      "Epoch 552/5000\n",
      "1257/1257 [==============================] - 0s 53us/step - loss: 0.3158 - val_loss: 0.3274\n",
      "\n",
      "Epoch 00552: val_loss did not improve from 0.32437\n",
      "Epoch 553/5000\n",
      "1257/1257 [==============================] - 0s 64us/step - loss: 0.3161 - val_loss: 0.3256\n",
      "\n",
      "Epoch 00553: val_loss did not improve from 0.32437\n",
      "Epoch 554/5000\n",
      "1257/1257 [==============================] - 0s 52us/step - loss: 0.3156 - val_loss: 0.3247\n",
      "\n",
      "Epoch 00554: val_loss did not improve from 0.32437\n",
      "Epoch 555/5000\n",
      "1257/1257 [==============================] - 0s 53us/step - loss: 0.3151 - val_loss: 0.3241\n",
      "\n",
      "Epoch 00555: val_loss improved from 0.32437 to 0.32407, saving model to autoencode_digit.hdf5\n",
      "Epoch 556/5000\n",
      "1257/1257 [==============================] - 0s 53us/step - loss: 0.3150 - val_loss: 0.3256\n",
      "\n",
      "Epoch 00556: val_loss did not improve from 0.32407\n",
      "Epoch 557/5000\n",
      "1257/1257 [==============================] - 0s 52us/step - loss: 0.3157 - val_loss: 0.3249\n",
      "\n",
      "Epoch 00557: val_loss did not improve from 0.32407\n",
      "Epoch 558/5000\n",
      "1257/1257 [==============================] - 0s 53us/step - loss: 0.3153 - val_loss: 0.3252\n",
      "\n",
      "Epoch 00558: val_loss did not improve from 0.32407\n",
      "Epoch 559/5000\n",
      "1257/1257 [==============================] - 0s 53us/step - loss: 0.3149 - val_loss: 0.3248\n",
      "\n",
      "Epoch 00559: val_loss did not improve from 0.32407\n",
      "Epoch 560/5000\n",
      "1257/1257 [==============================] - 0s 53us/step - loss: 0.3148 - val_loss: 0.3242\n",
      "\n",
      "Epoch 00560: val_loss did not improve from 0.32407\n",
      "Epoch 561/5000\n",
      "1257/1257 [==============================] - 0s 52us/step - loss: 0.3152 - val_loss: 0.3237\n",
      "\n",
      "Epoch 00561: val_loss improved from 0.32407 to 0.32369, saving model to autoencode_digit.hdf5\n",
      "Epoch 562/5000\n",
      "1257/1257 [==============================] - 0s 51us/step - loss: 0.3153 - val_loss: 0.3243\n",
      "\n",
      "Epoch 00562: val_loss did not improve from 0.32369\n",
      "Epoch 563/5000\n",
      "1257/1257 [==============================] - 0s 51us/step - loss: 0.3146 - val_loss: 0.3250\n",
      "\n",
      "Epoch 00563: val_loss did not improve from 0.32369\n",
      "Epoch 564/5000\n",
      "1257/1257 [==============================] - 0s 58us/step - loss: 0.3154 - val_loss: 0.3245\n",
      "\n",
      "Epoch 00564: val_loss did not improve from 0.32369\n",
      "Epoch 565/5000\n",
      "1257/1257 [==============================] - 0s 57us/step - loss: 0.3148 - val_loss: 0.3256\n",
      "\n",
      "Epoch 00565: val_loss did not improve from 0.32369\n",
      "Epoch 566/5000\n",
      "1257/1257 [==============================] - 0s 60us/step - loss: 0.3161 - val_loss: 0.3245\n",
      "\n",
      "Epoch 00566: val_loss did not improve from 0.32369\n",
      "Epoch 567/5000\n",
      "1257/1257 [==============================] - 0s 58us/step - loss: 0.3153 - val_loss: 0.3240\n",
      "\n",
      "Epoch 00567: val_loss did not improve from 0.32369\n",
      "Epoch 568/5000\n",
      "1257/1257 [==============================] - 0s 58us/step - loss: 0.3145 - val_loss: 0.3248\n",
      "\n",
      "Epoch 00568: val_loss did not improve from 0.32369\n",
      "Epoch 569/5000\n",
      "1257/1257 [==============================] - 0s 54us/step - loss: 0.3144 - val_loss: 0.3236\n",
      "\n",
      "Epoch 00569: val_loss improved from 0.32369 to 0.32359, saving model to autoencode_digit.hdf5\n",
      "Epoch 570/5000\n",
      "1257/1257 [==============================] - 0s 51us/step - loss: 0.3147 - val_loss: 0.3239\n",
      "\n",
      "Epoch 00570: val_loss did not improve from 0.32359\n",
      "Epoch 571/5000\n",
      "1257/1257 [==============================] - 0s 64us/step - loss: 0.3146 - val_loss: 0.3253\n",
      "\n",
      "Epoch 00571: val_loss did not improve from 0.32359\n",
      "Epoch 572/5000\n",
      "1257/1257 [==============================] - 0s 61us/step - loss: 0.3146 - val_loss: 0.3237\n",
      "\n",
      "Epoch 00572: val_loss did not improve from 0.32359\n",
      "Epoch 573/5000\n",
      "1257/1257 [==============================] - 0s 53us/step - loss: 0.3144 - val_loss: 0.3239\n",
      "\n",
      "Epoch 00573: val_loss did not improve from 0.32359\n",
      "Epoch 574/5000\n",
      "1257/1257 [==============================] - 0s 128us/step - loss: 0.3148 - val_loss: 0.3240\n",
      "\n",
      "Epoch 00574: val_loss did not improve from 0.32359\n",
      "Epoch 575/5000\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "1257/1257 [==============================] - 0s 83us/step - loss: 0.3147 - val_loss: 0.3252\n",
      "\n",
      "Epoch 00575: val_loss did not improve from 0.32359\n",
      "Epoch 576/5000\n",
      "1257/1257 [==============================] - 0s 106us/step - loss: 0.3145 - val_loss: 0.3249\n",
      "\n",
      "Epoch 00576: val_loss did not improve from 0.32359\n",
      "Epoch 577/5000\n",
      "1257/1257 [==============================] - 0s 120us/step - loss: 0.3150 - val_loss: 0.3238\n",
      "\n",
      "Epoch 00577: val_loss did not improve from 0.32359\n",
      "Epoch 578/5000\n",
      "1257/1257 [==============================] - 0s 113us/step - loss: 0.3151 - val_loss: 0.3267\n",
      "\n",
      "Epoch 00578: val_loss did not improve from 0.32359\n",
      "Epoch 579/5000\n",
      "1257/1257 [==============================] - 0s 95us/step - loss: 0.3157 - val_loss: 0.3245\n",
      "\n",
      "Epoch 00579: val_loss did not improve from 0.32359\n",
      "Epoch 580/5000\n",
      "1257/1257 [==============================] - 0s 84us/step - loss: 0.3153 - val_loss: 0.3237\n",
      "\n",
      "Epoch 00580: val_loss did not improve from 0.32359\n",
      "Epoch 581/5000\n",
      "1257/1257 [==============================] - 0s 78us/step - loss: 0.3143 - val_loss: 0.3251\n",
      "\n",
      "Epoch 00581: val_loss did not improve from 0.32359\n",
      "Epoch 582/5000\n",
      "1257/1257 [==============================] - 0s 73us/step - loss: 0.3150 - val_loss: 0.3243\n",
      "\n",
      "Epoch 00582: val_loss did not improve from 0.32359\n",
      "Epoch 583/5000\n",
      "1257/1257 [==============================] - 0s 69us/step - loss: 0.3142 - val_loss: 0.3250\n",
      "\n",
      "Epoch 00583: val_loss did not improve from 0.32359\n",
      "Epoch 584/5000\n",
      "1257/1257 [==============================] - 0s 59us/step - loss: 0.3142 - val_loss: 0.3240\n",
      "\n",
      "Epoch 00584: val_loss did not improve from 0.32359\n",
      "Epoch 585/5000\n",
      "1257/1257 [==============================] - 0s 56us/step - loss: 0.3149 - val_loss: 0.3242\n",
      "\n",
      "Epoch 00585: val_loss did not improve from 0.32359\n",
      "Epoch 586/5000\n",
      "1257/1257 [==============================] - 0s 59us/step - loss: 0.3143 - val_loss: 0.3237\n",
      "\n",
      "Epoch 00586: val_loss did not improve from 0.32359\n",
      "Epoch 587/5000\n",
      "1257/1257 [==============================] - 0s 91us/step - loss: 0.3142 - val_loss: 0.3234\n",
      "\n",
      "Epoch 00587: val_loss improved from 0.32359 to 0.32336, saving model to autoencode_digit.hdf5\n",
      "Epoch 588/5000\n",
      "1257/1257 [==============================] - 0s 71us/step - loss: 0.3141 - val_loss: 0.3240\n",
      "\n",
      "Epoch 00588: val_loss did not improve from 0.32336\n",
      "Epoch 589/5000\n",
      "1257/1257 [==============================] - 0s 62us/step - loss: 0.3142 - val_loss: 0.3236\n",
      "\n",
      "Epoch 00589: val_loss did not improve from 0.32336\n",
      "Epoch 590/5000\n",
      "1257/1257 [==============================] - 0s 62us/step - loss: 0.3139 - val_loss: 0.3245\n",
      "\n",
      "Epoch 00590: val_loss did not improve from 0.32336\n",
      "Epoch 591/5000\n",
      "1257/1257 [==============================] - 0s 59us/step - loss: 0.3140 - val_loss: 0.3246\n",
      "\n",
      "Epoch 00591: val_loss did not improve from 0.32336\n",
      "Epoch 592/5000\n",
      "1257/1257 [==============================] - 0s 55us/step - loss: 0.3140 - val_loss: 0.3245\n",
      "\n",
      "Epoch 00592: val_loss did not improve from 0.32336\n",
      "Epoch 593/5000\n",
      "1257/1257 [==============================] - 0s 69us/step - loss: 0.3138 - val_loss: 0.3237\n",
      "\n",
      "Epoch 00593: val_loss did not improve from 0.32336\n",
      "Epoch 594/5000\n",
      "1257/1257 [==============================] - 0s 66us/step - loss: 0.3137 - val_loss: 0.3238\n",
      "\n",
      "Epoch 00594: val_loss did not improve from 0.32336\n",
      "Epoch 595/5000\n",
      "1257/1257 [==============================] - 0s 59us/step - loss: 0.3137 - val_loss: 0.3236\n",
      "\n",
      "Epoch 00595: val_loss did not improve from 0.32336\n",
      "Epoch 596/5000\n",
      "1257/1257 [==============================] - 0s 56us/step - loss: 0.3136 - val_loss: 0.3229\n",
      "\n",
      "Epoch 00596: val_loss improved from 0.32336 to 0.32291, saving model to autoencode_digit.hdf5\n",
      "Epoch 597/5000\n",
      "1257/1257 [==============================] - 0s 74us/step - loss: 0.3144 - val_loss: 0.3241\n",
      "\n",
      "Epoch 00597: val_loss did not improve from 0.32291\n",
      "Epoch 598/5000\n",
      "1257/1257 [==============================] - 0s 82us/step - loss: 0.3138 - val_loss: 0.3247\n",
      "\n",
      "Epoch 00598: val_loss did not improve from 0.32291\n",
      "Epoch 599/5000\n",
      "1257/1257 [==============================] - 0s 55us/step - loss: 0.3137 - val_loss: 0.3243\n",
      "\n",
      "Epoch 00599: val_loss did not improve from 0.32291\n",
      "Epoch 600/5000\n",
      "1257/1257 [==============================] - 0s 55us/step - loss: 0.3136 - val_loss: 0.3244\n",
      "\n",
      "Epoch 00600: val_loss did not improve from 0.32291\n",
      "Epoch 601/5000\n",
      "1257/1257 [==============================] - 0s 75us/step - loss: 0.3145 - val_loss: 0.3248\n",
      "\n",
      "Epoch 00601: val_loss did not improve from 0.32291\n",
      "Epoch 602/5000\n",
      "1257/1257 [==============================] - 0s 51us/step - loss: 0.3141 - val_loss: 0.3241\n",
      "\n",
      "Epoch 00602: val_loss did not improve from 0.32291\n",
      "Epoch 603/5000\n",
      "1257/1257 [==============================] - 0s 62us/step - loss: 0.3144 - val_loss: 0.3246\n",
      "\n",
      "Epoch 00603: val_loss did not improve from 0.32291\n",
      "Epoch 604/5000\n",
      "1257/1257 [==============================] - 0s 57us/step - loss: 0.3143 - val_loss: 0.3277\n",
      "\n",
      "Epoch 00604: val_loss did not improve from 0.32291\n",
      "Epoch 605/5000\n",
      "1257/1257 [==============================] - 0s 53us/step - loss: 0.3150 - val_loss: 0.3240\n",
      "\n",
      "Epoch 00605: val_loss did not improve from 0.32291\n",
      "Epoch 606/5000\n",
      "1257/1257 [==============================] - 0s 48us/step - loss: 0.3144 - val_loss: 0.3236\n",
      "\n",
      "Epoch 00606: val_loss did not improve from 0.32291\n",
      "Epoch 607/5000\n",
      "1257/1257 [==============================] - 0s 53us/step - loss: 0.3139 - val_loss: 0.3235\n",
      "\n",
      "Epoch 00607: val_loss did not improve from 0.32291\n",
      "Epoch 608/5000\n",
      "1257/1257 [==============================] - 0s 51us/step - loss: 0.3134 - val_loss: 0.3235\n",
      "\n",
      "Epoch 00608: val_loss did not improve from 0.32291\n",
      "Epoch 609/5000\n",
      "1257/1257 [==============================] - 0s 47us/step - loss: 0.3139 - val_loss: 0.3253\n",
      "\n",
      "Epoch 00609: val_loss did not improve from 0.32291\n",
      "Epoch 610/5000\n",
      "1257/1257 [==============================] - 0s 53us/step - loss: 0.3138 - val_loss: 0.3236\n",
      "\n",
      "Epoch 00610: val_loss did not improve from 0.32291\n",
      "Epoch 611/5000\n",
      "1257/1257 [==============================] - 0s 50us/step - loss: 0.3132 - val_loss: 0.3233\n",
      "\n",
      "Epoch 00611: val_loss did not improve from 0.32291\n",
      "Epoch 612/5000\n",
      "1257/1257 [==============================] - 0s 49us/step - loss: 0.3134 - val_loss: 0.3258\n",
      "\n",
      "Epoch 00612: val_loss did not improve from 0.32291\n",
      "Epoch 613/5000\n",
      "1257/1257 [==============================] - 0s 49us/step - loss: 0.3139 - val_loss: 0.3234\n",
      "\n",
      "Epoch 00613: val_loss did not improve from 0.32291\n",
      "Epoch 614/5000\n",
      "1257/1257 [==============================] - 0s 55us/step - loss: 0.3132 - val_loss: 0.3235\n",
      "\n",
      "Epoch 00614: val_loss did not improve from 0.32291\n",
      "Epoch 615/5000\n",
      "1257/1257 [==============================] - 0s 41us/step - loss: 0.3132 - val_loss: 0.3241\n",
      "\n",
      "Epoch 00615: val_loss did not improve from 0.32291\n",
      "Epoch 616/5000\n",
      "1257/1257 [==============================] - 0s 52us/step - loss: 0.3132 - val_loss: 0.3236\n",
      "\n",
      "Epoch 00616: val_loss did not improve from 0.32291\n",
      "Epoch 617/5000\n",
      "1257/1257 [==============================] - 0s 43us/step - loss: 0.3133 - val_loss: 0.3231\n",
      "\n",
      "Epoch 00617: val_loss did not improve from 0.32291\n",
      "Epoch 618/5000\n",
      "1257/1257 [==============================] - 0s 44us/step - loss: 0.3130 - val_loss: 0.3240\n",
      "\n",
      "Epoch 00618: val_loss did not improve from 0.32291\n",
      "Epoch 619/5000\n",
      "1257/1257 [==============================] - 0s 42us/step - loss: 0.3129 - val_loss: 0.3234\n",
      "\n",
      "Epoch 00619: val_loss did not improve from 0.32291\n",
      "Epoch 620/5000\n",
      "1257/1257 [==============================] - 0s 70us/step - loss: 0.3131 - val_loss: 0.3239\n",
      "\n",
      "Epoch 00620: val_loss did not improve from 0.32291\n",
      "Epoch 621/5000\n",
      "1257/1257 [==============================] - 0s 85us/step - loss: 0.3131 - val_loss: 0.3237\n",
      "\n",
      "Epoch 00621: val_loss did not improve from 0.32291\n",
      "Epoch 622/5000\n",
      "1257/1257 [==============================] - 0s 65us/step - loss: 0.3130 - val_loss: 0.3246\n",
      "\n",
      "Epoch 00622: val_loss did not improve from 0.32291\n",
      "Epoch 623/5000\n",
      "1257/1257 [==============================] - 0s 65us/step - loss: 0.3135 - val_loss: 0.3242\n",
      "\n",
      "Epoch 00623: val_loss did not improve from 0.32291\n",
      "Epoch 624/5000\n",
      "1257/1257 [==============================] - 0s 67us/step - loss: 0.3130 - val_loss: 0.3237\n",
      "\n",
      "Epoch 00624: val_loss did not improve from 0.32291\n",
      "Epoch 625/5000\n",
      "1257/1257 [==============================] - 0s 63us/step - loss: 0.3128 - val_loss: 0.3235\n",
      "\n",
      "Epoch 00625: val_loss did not improve from 0.32291\n",
      "Epoch 626/5000\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "1257/1257 [==============================] - 0s 61us/step - loss: 0.3129 - val_loss: 0.3237\n",
      "\n",
      "Epoch 00626: val_loss did not improve from 0.32291\n",
      "Epoch 627/5000\n",
      "1257/1257 [==============================] - 0s 56us/step - loss: 0.3131 - val_loss: 0.3248\n",
      "\n",
      "Epoch 00627: val_loss did not improve from 0.32291\n",
      "Epoch 628/5000\n",
      "1257/1257 [==============================] - 0s 57us/step - loss: 0.3133 - val_loss: 0.3242\n",
      "\n",
      "Epoch 00628: val_loss did not improve from 0.32291\n",
      "Epoch 629/5000\n",
      "1257/1257 [==============================] - 0s 79us/step - loss: 0.3131 - val_loss: 0.3237\n",
      "\n",
      "Epoch 00629: val_loss did not improve from 0.32291\n",
      "Epoch 630/5000\n",
      "1257/1257 [==============================] - 0s 65us/step - loss: 0.3128 - val_loss: 0.3237\n",
      "\n",
      "Epoch 00630: val_loss did not improve from 0.32291\n",
      "Epoch 631/5000\n",
      "1257/1257 [==============================] - 0s 78us/step - loss: 0.3132 - val_loss: 0.3253\n",
      "\n",
      "Epoch 00631: val_loss did not improve from 0.32291\n",
      "Epoch 632/5000\n",
      "1257/1257 [==============================] - 0s 62us/step - loss: 0.3135 - val_loss: 0.3239\n",
      "\n",
      "Epoch 00632: val_loss did not improve from 0.32291\n",
      "Epoch 633/5000\n",
      "1257/1257 [==============================] - 0s 65us/step - loss: 0.3135 - val_loss: 0.3232\n",
      "\n",
      "Epoch 00633: val_loss did not improve from 0.32291\n",
      "Epoch 634/5000\n",
      "1257/1257 [==============================] - 0s 63us/step - loss: 0.3130 - val_loss: 0.3237\n",
      "\n",
      "Epoch 00634: val_loss did not improve from 0.32291\n",
      "Epoch 635/5000\n",
      "1257/1257 [==============================] - 0s 53us/step - loss: 0.3128 - val_loss: 0.3244\n",
      "\n",
      "Epoch 00635: val_loss did not improve from 0.32291\n",
      "Epoch 636/5000\n",
      "1257/1257 [==============================] - 0s 54us/step - loss: 0.3134 - val_loss: 0.3238\n",
      "\n",
      "Epoch 00636: val_loss did not improve from 0.32291\n",
      "Epoch 637/5000\n",
      "1257/1257 [==============================] - 0s 52us/step - loss: 0.3130 - val_loss: 0.3233\n",
      "\n",
      "Epoch 00637: val_loss did not improve from 0.32291\n",
      "Epoch 638/5000\n",
      "1257/1257 [==============================] - 0s 65us/step - loss: 0.3132 - val_loss: 0.3249\n",
      "\n",
      "Epoch 00638: val_loss did not improve from 0.32291\n",
      "Epoch 639/5000\n",
      "1257/1257 [==============================] - 0s 94us/step - loss: 0.3134 - val_loss: 0.3232\n",
      "\n",
      "Epoch 00639: val_loss did not improve from 0.32291\n",
      "Epoch 640/5000\n",
      "1257/1257 [==============================] - 0s 71us/step - loss: 0.3127 - val_loss: 0.3235\n",
      "\n",
      "Epoch 00640: val_loss did not improve from 0.32291\n",
      "Epoch 641/5000\n",
      "1257/1257 [==============================] - 0s 82us/step - loss: 0.3123 - val_loss: 0.3236\n",
      "\n",
      "Epoch 00641: val_loss did not improve from 0.32291\n",
      "Epoch 642/5000\n",
      "1257/1257 [==============================] - 0s 70us/step - loss: 0.3124 - val_loss: 0.3238\n",
      "\n",
      "Epoch 00642: val_loss did not improve from 0.32291\n",
      "Epoch 643/5000\n",
      "1257/1257 [==============================] - 0s 75us/step - loss: 0.3125 - val_loss: 0.3233\n",
      "\n",
      "Epoch 00643: val_loss did not improve from 0.32291\n",
      "Epoch 644/5000\n",
      "1257/1257 [==============================] - 0s 77us/step - loss: 0.3127 - val_loss: 0.3231\n",
      "\n",
      "Epoch 00644: val_loss did not improve from 0.32291\n",
      "Epoch 645/5000\n",
      "1257/1257 [==============================] - 0s 70us/step - loss: 0.3124 - val_loss: 0.3244\n",
      "\n",
      "Epoch 00645: val_loss did not improve from 0.32291\n",
      "Epoch 646/5000\n",
      "1257/1257 [==============================] - 0s 64us/step - loss: 0.3123 - val_loss: 0.3233\n",
      "\n",
      "Epoch 00646: val_loss did not improve from 0.32291\n"
     ]
    }
   ],
   "source": [
    "#notice that input and outputs are same\n",
    "score = model.fit(train_x, train_x, epochs=5000, validation_data=(val_x, val_x), callbacks=[checkpointer, earlyStop])"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Restore the best weights"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "metadata": {},
   "outputs": [],
   "source": [
    "from keras.models import load_model\n",
    "model = load_model(\"autoencode_digit.hdf5\")\n",
    "model.save_weights('autoencode_digit.h5')"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Monitor train and validation loss"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "metadata": {},
   "outputs": [],
   "source": [
    "best_iteration = np.argmin(score.history['val_loss'])+1\n",
    "\n",
    "val_scores = score.history['val_loss'][0:best_iteration]\n",
    "train_scores = score.history['loss'][0:best_iteration]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAX0AAAD8CAYAAACb4nSYAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMi4yLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvhp/UCwAAIABJREFUeJzt3Xt8XGW97/HPby6ZyT1pkrbpNSmkLbSFFsJNQEG5lAKFA4gVUOrenm62oKgHj/Scs1Er7O3x+JLtfp0KohY8bhUUNliwGwS0IvemUi6939s0vaS53ycz8zt/PKtlGpLJtE2bZPJ7v155ZdaatdY8TyjftdbzPOsZUVWMMcaMDL7BLoAxxpiTx0LfGGNGEAt9Y4wZQSz0jTFmBLHQN8aYEcRC3xhjRhALfWOMGUEs9I0xZgSx0DfGmBEkMNgF6Km4uFjLysoGuxjGGDOsrF69+qCqlvS33ZAL/bKyMqqqqga7GMYYM6yIyM5UtrPmHWOMGUEs9I0xZgSx0DfGmBFkyLXpG2PSU3d3N9XV1XR2dg52UYa1cDjMhAkTCAaDx7S/hb4x5qSorq4mNzeXsrIyRGSwizMsqSp1dXVUV1dTXl5+TMew5h1jzEnR2dlJUVGRBf5xEBGKioqO627JQt8Yc9JY4B+/4/0bpk/od7XCn+6Hahvjb4wxfUmf0O/ugFf+D9S8M9glMcaYISt9Ql+8qtgXvRtjBkBOTk6f7+3YsYOZM2eexNIMnDQKfa+dS+ODWw5jjBnC0nDIpl3pGzPUfefZtayraR7QY54+Lo9vXTujz/e/+c1vMnnyZL70pS8B8O1vfxsR4ZVXXqGhoYHu7m7uv/9+rrvuuqP63M7OTv7xH/+RqqoqAoEAP/zhD7n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/2QrqOIBHGB/ytV/Q9v9bCsyyGq2gisxPVTFIibhwqOLO/hunjv5wP1J7ekfboQmC8iO3ATIX4Sd+U/HOsCgKrWeL8PAE/jTsrD8d9ZNVCtqm95y0/iTgInvC7pEvqrgApvVEIG7tu6lg9ymY7Vcry5i7zfv09Y/3mvF/98oOnQbeBgExEBfg6sV9UfJrw1HOtSIiIF3utM4DJcB9ufgZu8zXrW5VAdbwL+pF6j62BT1cWqOkFVy3D/T/xJVW9lGNYFQESyRST30GvgCuADhuG/M1XdB+wWkWneqk/h5ig78XUZ7A6NAewYmYebDXQr8D8Huzwplvk3wF7cRHXVuNETRbiOt83e71HetoIbobQVeB+oHOzyJ9TjItyt5nvAGu9n3jCtyxnAO15dPgDu89ZPAd7Gffvb74CQtz7sLW/x3p8y2HXoo16XAM8N57p45X7X+1l76P/z4fjvzCvfbKDK+7f2DFB4MupiT+QaY8wIki7NO8YYY1JgoW+MMSOIhb4xxowgFvrGGDOCWOgbY8wIYqFvjDEjiIW+McaMIBb6xhgzgvx/9ye1C15gBJYAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "plt.plot(val_scores, label='val_loss')\n",
    "plt.plot(train_scores, label='train_loss')\n",
    "plt.legend(loc='upper right')\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Performance\n",
    "\n",
    "We expect that validation and test set scores should be close"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 22,
   "metadata": {},
   "outputs": [],
   "source": [
    "from sklearn.metrics import mean_squared_error, mean_absolute_error\n",
    "from math import sqrt"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 23,
   "metadata": {},
   "outputs": [],
   "source": [
    "def calculatePerformance(x):\n",
    "    predictions = model.predict(x)\n",
    "    actuals = x.copy()\n",
    "    \n",
    "    return mean_absolute_error(actuals, predictions), sqrt(mean_squared_error(actuals, predictions))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 24,
   "metadata": {},
   "outputs": [],
   "source": [
    "val_perf = calculatePerformance(val_x)\n",
    "test_perf = calculatePerformance(test_x)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 25,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0.1146375678415188"
      ]
     },
     "execution_count": 25,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "test_perf[0]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 26,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0.11345667229361296"
      ]
     },
     "execution_count": 26,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "val_perf[0]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 27,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "True"
      ]
     },
     "execution_count": 27,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "#mae check\n",
    "abs(val_perf[0] - test_perf[0]) < 0.01"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 28,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "True"
      ]
     },
     "execution_count": 28,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "#rmse check\n",
    "abs(val_perf[1] - test_perf[1]) < 0.01"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Autoencode and autodecode"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 29,
   "metadata": {},
   "outputs": [],
   "source": [
    "def autoEncodeDecode(x, model):\n",
    "    decoded_imgs = model.predict(x)\n",
    "    summary_layer_idx = int(len(model.layers) / 2) - 1\n",
    "    get_layer_output = K.function([model.layers[0].input], [model.layers[summary_layer_idx].output])\n",
    "    compressed = get_layer_output([x])[0]\n",
    "    \n",
    "    x = x.reshape(x.shape[0], 8, 8)\n",
    "    decoded_imgs = decoded_imgs.reshape(decoded_imgs.shape[0], 8, 8)\n",
    "    compressed = compressed.reshape(compressed.shape[0], 1, 2)\n",
    "    \n",
    "    return x, decoded_imgs, compressed"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 30,
   "metadata": {},
   "outputs": [],
   "source": [
    "autoencodings = autoEncodeDecode(test_x, model)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 31,
   "metadata": {},
   "outputs": [],
   "source": [
    "original_imgs = autoencodings[0]\n",
    "reconstructed_imgs = autoencodings[1]\n",
    "compressed = autoencodings[2]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 32,
   "metadata": {
    "scrolled": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "original image:\n"
     ]
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAPgAAAD8CAYAAABaQGkdAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMi4yLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvhp/UCwAACsRJREFUeJzt3d2LXeUZhvH7blQaNRpobdFMaBRkQAo1IgEJiI1tiVV0DnqQgEKkkCMloQXRHtl/QNKDIoSoFUyVNn4iVivoYIXWmsRpazKxpGFKptFGKfGr0CH69GB2SppO2e9kv+tjHq4fBGcmm3mfTbhca/asvV5HhADk9IWuBwDQHAIHEiNwIDECBxIjcCAxAgcSI3AgMQIHEiNwILFzmvimtlNeHrd8+fJW17vssstaW2vFihWtrTU3N9faWocPH25tLand5xYRHvaYRgLPanx8vNX17r///tbWuuGGG1pba2ZmprW1JiYmWltLave5leAUHUiMwIHECBxIjMCBxAgcSIzAgcQIHEiMwIHEigK3vdH2O7YP27636aEA1DE0cNvLJP1U0k2SrpK02fZVTQ8GYHQlR/B1kg5HxJGImJP0hKTbmh0LQA0lga+SdPS0z2cHXwPQcyVvNlnoHSv/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
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "autoencoding:  [42.43143  11.366243] \n",
      "\n",
      "reconstructed image:\n"
     ]
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAPgAAAD8CAYAAABaQGkdAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMi4yLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvhp/UCwAACw9JREFUeJzt3f+rlvUdx/HXq5M2UyPadJTKTgMRQjAlhBCCmRu2wvbDIIWCReBPRrGB1H7bPxDthxGI1YJcsVlCRqsFFS3YWh4927Jjw0nDM0uTdbCUPOl574dzC86dcV/H+7o+93W/93yAdL7c+HnfyLPrOve57uvjiBCAnK7o9wAAmkPgQGIEDiRG4EBiBA4kRuBAYgQOJEbgQGIEDiR2ZRN/qe2Ul8fNnTu36HqLFy8uttZ1111XbK2JiYlia42PjxdbS5KmpqaKrRUR7vaYRgLP6oYbbii63rZt24qttWXLlmJr7d27t9ha27dvL7aWJJ06daroet1wig4kRuBAYgQOJEbgQGIEDiRG4EBiBA4kRuBAYpUCt73R9oe2D9t+pOmhANSja+C2hyT9QtIdkm6StMX2TU0PBqB3VY7gayUdjogjETEp6XlJdzc7FoA6VAl8iaSjF30+3vkagJar8maTmd6x8l/vFrO9VdLWnicCUJsqgY9LWnbR50slHbv0QRGxQ9IOKe/bRYFBU+UU/T1Jy23faHuupM2SXmp2LAB16HoEj4hztrdJek3SkKSnIuJg45MB6FmlGz5ExCuSXml4FgA140o2IDECBxIjcCAxAgcSI3AgMQIHEiNwIDECBxIb+J1N5syZU2ytDRs2FFtLku65556i65WyatWqYmvNmzev2FoSO5sAKIjAgcQIHEiMwIHECBxIjMCBxAgcSIzAgcQIHEisys4mT9k+Yfv9EgM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tXS/qupBebHQdAnaruTXZG0tcbngVAzbiSDUiMwIHECBxIjMCBxAgcSIzAgcQIHEiMwIHEHBH1/6X2p5Jm+5bSb0g6Wfsw7ZD1ufG8+udbEbGo24MaCfxy2N6X9Z1oWZ8bz6v9OEUHEiNwILE2Bb6j3wM0KOtz43m1XGt+BgdQvzYdwQHUrBWB295o+0Pbh20/0u956mB7me03bY/ZPmj7oX7PVCfbQ7YP2H6537PUyfa1tnfbPtT5t7u13zP1ou+n6J17rf9N03eMGZf0nqQtEfFBXwfrke3rJV0fEfttL5Q0IukHg/68LrD9Y0m3SLomIu7q9zx1sf2MpN9HxM7OjUavjoiJfs91udpwBF8r6XBEHImISUnPS7q7zzP1LCI+joj9nY8/lzQmaUl/p6qH7aWS7pS0s9+z1Mn2NZJuk/SkJEXE5CDHLbUj8CWSjl70+biShHCB7WFJqyW9299JavO4pO2Spvo9SM2+LelTSU93fvzYaXt+v4fqRRsC9wxfS/PSvu0Fkl6Q9HBEnOr3PL2yfZekExEx0u9ZGnClpDWSnoiI1ZJOSxro14TaEPi4pGUXfb5U0rE+zVIr23M0HfeuiMhyR9p1kjbZ/kjTP06tt/1sf0eqzbik8Yi4cKa1W9PBD6w2BP6epOW2b+y8qLFZ0kt9nqlntq3pn+XGIuKxfs9Tl4h4NCKWRsSwpv+t3oiIe/s8Vi0i4hNJR22v6HzpdkkD/aLobPcmq11EnLO9TdJrkoYkPRURB/s8Vh3WSbpP0l9tj3a+9tOIeKWPM6G7ByXt6hxsjki6v8/z9KTvvyYD0Jw2nKIDaAiBA4kROJAYgQOJETiQGIEDiRE4kBiBA4n9G81Omdz8i0boAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-----------------\n"
     ]
    }
   ],
   "source": [
    "for i in range(0, 1):\n",
    "    \n",
    "    print(\"original image:\")\n",
    "    plt.imshow(original_imgs[i])\n",
    "    plt.gray()\n",
    "    plt.show()\n",
    "    \n",
    "    print(\"autoencoding: \", compressed[i, 0],\"\\n\")\n",
    "    \n",
    "    print(\"reconstructed image:\")\n",
    "    plt.imshow(reconstructed_imgs[i])\n",
    "    plt.gray()\n",
    "    plt.show()\n",
    "    \n",
    "    print(\"-----------------\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 33,
   "metadata": {},
   "outputs": [],
   "source": [
    "compressed = compressed.reshape(compressed.shape[0], 2)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 34,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[42.43143  , 11.366243 ],\n",
       "       [29.368538 ,  4.6883845],\n",
       "       [33.664993 ,  3.5971076],\n",
       "       [21.441372 ,  3.1556783],\n",
       "       [59.590984 , 21.33383  ]], dtype=float32)"
      ]
     },
     "execution_count": 34,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "compressed[0:5]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 35,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([9, 2, 2, 8, 4])"
      ]
     },
     "execution_count": 35,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "test_y[0:5]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 36,
   "metadata": {},
   "outputs": [],
   "source": [
    "pivot = pd.DataFrame(compressed, columns = [\"x1\", \"x2\"])\n",
    "pivot[\"label\"] = test_y"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 37,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>x1</th>\n",
       "      <th>x2</th>\n",
       "      <th>label</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>42.431431</td>\n",
       "      <td>11.366243</td>\n",
       "      <td>9</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>29.368538</td>\n",
       "      <td>4.688385</td>\n",
       "      <td>2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>33.664993</td>\n",
       "      <td>3.597108</td>\n",
       "      <td>2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>21.441372</td>\n",
       "      <td>3.155678</td>\n",
       "      <td>8</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>59.590984</td>\n",
       "      <td>21.333830</td>\n",
       "      <td>4</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "          x1         x2  label\n",
       "0  42.431431  11.366243      9\n",
       "1  29.368538   4.688385      2\n",
       "2  33.664993   3.597108      2\n",
       "3  21.441372   3.155678      8\n",
       "4  59.590984  21.333830      4"
      ]
     },
     "execution_count": 37,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "pivot.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 38,
   "metadata": {},
   "outputs": [],
   "source": [
    "colors = [\"red\", \"green\", \"blue\", \"orange\", \"black\", \"purple\", \"yellow\", \"grey\", \"pink\", \"brown\"]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 39,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<matplotlib.legend.Legend at 0x245551bc940>"
      ]
     },
     "execution_count": 39,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAABIEAAAJCCAYAAABXmtfhAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMi4yLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvhp/UCwAAIABJREFUeJzs3X2sZPlZH/jvucwZW3KZjvFL5OkpNCRYMHida+hLFVEDcVhZLANKNkFrgcIuUchSEzmloESqjSJZROKPoNKSDbqRMs2IaLNw12ilRALZzUgJZkO2tarbd5ZbGYcJ8kp4c6ax8diQjmsS02fmnv2jum6/TPf07b4v9fb5SKOaOn36nMcj97x8+/k9T9E0TQAAAABYbRvzLgAAAACA0ycEAgAAAFgDQiAAAACANSAEAgAAAFgDQiAAAACANSAEAgAAAFgDQiAAAACANSAEAgAAAFgDQiAAAACANfDYWb7sPe95T/PUU0+d5SsBAAAAVtqLL7745aZp3vug+840BHrqqaeyt7d3lq8EAAAAWGlFUfx/R7nPcTAAAACANSAEAgAAAFgDQiAAAACANXCmM4Hupa7rvPLKK/na174271Lu6+1vf3uefPLJlGU571IAAAAAHsncQ6BXXnkl73znO/PUU0+lKIp5l/MmTdPkK1/5Sl555ZV80zd907zLAQAAAHgkcz8O9rWvfS3vfve7FzIASpKiKPLud797oTuVAAAAAB5k7iFQkoUNgGYWvT4AAACAB1mIEAgAAACA0yUEuumFF17It3zLt+Sbv/mb87M/+7PzLgcAAADgRAmBkrzxxhv5+Mc/nl//9V/P7/zO7+STn/xkfud3fmfeZQEAAACcmOULgaoq6feTTmf6WVXHfuTu7m6++Zu/OX/qT/2pPP744/mRH/mR/Oqv/uoJFAsAAACwGOa+Iv6hVFWyuZlMJkldJ/v7yc5OMh4n7fYjP/batWtp3/bzn3zyyYxGo5OoGAAAAGAhLFcn0HB4KwBKpp+TyfT6MTRN86ZrNoIBAAAAq2S5QqDR6FYANFPXye7usR775JNPprrtWN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3s3fVeS/xPnFpP1/bnZCpY4vxjf7yZ5eynlFb3Pj/1/u7zvGkGpVcUUs1NK+fYk/zvJp3JzrsY/SzMX6ENJ/niaF/1fq7U+N5ODZG6VUt6cZkjcHWlC7w/VWv9FKeUNaao3vjHJJ5O8t9b6wuyOlHlWSvmLSf5JrfV7nFtMQu88+kjv6p1JfrHW+lOllNfE70bGVEp5S5qB9ncl+WySH0zvd2ScW4yplPKKJN0kb6i1Xund5t8uxlZK+YkkfyPNdulPJvm7aWYAed91QEIgAAAAgAWgHQwAAABgAQiBAAAAABaAEAgAAABgAQiBAAAAABaAEAgAAABgAQiBAAAAABaAEAgAAABgAQiBAAAAABbA/wcOQli9ceBBeQAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<Figure size 1440x720 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "fig, ax = plt.subplots(figsize=(20, 10))\n",
    "\n",
    "for i in range(0, 5):\n",
    "    tmp = pivot[pivot.label == i]\n",
    "    ax.scatter(tmp.x1, tmp.x2, s = 30, c = colors[i], label = str(i))\n",
    "\n",
    "ax.legend(loc=\"upper left\")\n",
    "#ax.set(xlim=(-0.1, 10), ylim=(-0.1, 10))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.5.5"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
